這有點奇怪,或者可能是我遺漏了一些東西。我正在使用 Spring Boot 應用程序發布 SOAP 端點。下面是pom.xml文件<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion> ..................<parent> .............</parent><groupId>com.gd</groupId><artifactId>sl</artifactId><version>0.0.1-SNAPSHOT</version><name>sl</name><description>Demo project for Spring Boot</description><properties> <java.version>1.8</java.version></properties><dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> </dependency></dependencies> ..........plugin and other stuff.根據教程,我們只需要 wsdl4j 依賴項來發布 SOAP 端點。下面是我的端點類 -@Endpointpublic class UserDetailsEndpoint {}這很簡單,但是 Eclipse 顯示編譯錯誤并且沒有將 @Endpoint 注釋解析為import org.springframework.ws.server.endpoint.annotation.Endpoint;可能是什么問題,我錯過了什么?
1 回答

FFIVE
TA貢獻1797條經驗 獲得超6個贊
嘗試添加此依賴項:
<!-- https://mvnrepository.com/artifact/org.springframework.ws/spring-ws-core -->
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
找到所需依賴項的一種通常成功的方法是簡單地搜索“maven <missing-package>”。
在這種情況下,我搜索“maven org.springframework.ws”并找到了這種依賴關系。
添加回答
舉報
0/150
提交
取消