2017-05-12 143 views
0

我已更新到Spring Boot 1.5.3,並且作爲升級的一部分,我在pom.xml中將spring-boot-starter-ws.jar更換爲spring-boot-starter-web-services.jar。但我有一個傳遞依賴spring-ws-core.jar的問題。下面是截圖Spring Boot 1.5.3傳遞依賴不解決

enter image description here

以下是依賴層次

enter image description here

不知道爲什麼它不能夠找到這種依賴的類。有什麼建議麼?

<dependencies> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <scope>provided</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-aop</artifactId> 
    </dependency> 

    <!-- 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-test</artifactId> 
     <scope>test</scope> 
    </dependency> 
    --> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
     <scope>test</scope> 
    </dependency> 

    <!-- for SpringDispatcher Servlet --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
    </dependency> 

    <!-- for HttpInvoker --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
    </dependency> 

    <!-- JSP --> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
    </dependency> 

    <!-- Spring Security --> 
    <!-- 
     <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-web</artifactId> 
     </dependency> 

     <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-config</artifactId> 
     </dependency> 
    --> 

    <!-- for Object Relational Mapping (JPA/Hibernate) --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-orm</artifactId> 
    </dependency> 

    <!-- Hibernate EntityManager for JPA (implementation) --> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-entitymanager</artifactId> 
    </dependency> 

    <!-- Database --> 
    <dependency> 
     <groupId>com.h2database</groupId> 
     <artifactId>h2</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.flywaydb</groupId> 
     <artifactId>flyway-core</artifactId> 
    </dependency> 

    <!-- hibernate --> 
    <dependency> 
     <groupId>org.hibernate.javax.persistence</groupId> 
     <artifactId>hibernate-jpa-2.1-api</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>cglib</groupId> 
     <artifactId>cglib</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-validator</artifactId> 
    </dependency> 

    <!-- CXF for REST and Webservices --> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-frontend-jaxws</artifactId> 
     <exclusions> 
     <exclusion> 
      <groupId>asm</groupId> 
      <artifactId>asm</artifactId> 
     </exclusion> 
     </exclusions> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-frontend-jaxrs</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-rs-client</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-rs-service-description</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-transports-http</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>com.fasterxml.jackson.jaxrs</groupId> 
     <artifactId>jackson-jaxrs-json-provider</artifactId> 
    </dependency> 

    <!-- Web Sockets --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-websocket</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-messaging</artifactId> 
    </dependency> 

    <!-- Tests --> 
    <dependency> 
     <groupId>org.springframework.batch</groupId> 
     <artifactId>spring-batch-test</artifactId> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>io.oasp.java.modules</groupId> 
     <artifactId>oasp4j-test</artifactId> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>javax.el</groupId> 
     <artifactId>javax.el-api</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-jdbc</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-actuator</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-security</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.scala-lang</groupId> 
     <artifactId>scala-library</artifactId> 
     <version>2.10.4</version> 
    </dependency> 

    <!-- 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-ws</artifactId> 
    </dependency> 
    --> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web-services</artifactId> 
     <version>1.5.2.RELEASE</version> 
    </dependency> 

    <dependency> 
     <groupId>com.mysema.querydsl</groupId> 
     <artifactId>querydsl-apt</artifactId> 
     <version>3.4.3</version> 
     <scope>provided</scope> 
    </dependency> 

    <dependency> 
     <groupId>com.mysema.querydsl</groupId> 
     <artifactId>querydsl-jpa</artifactId> 
     <version>3.7.1</version> 
    </dependency> 

    <dependency> 
     <groupId>org.skyscreamer</groupId> 
     <artifactId>jsonassert</artifactId> 
     <version>1.3.0</version> 
    <scope>test</scope> 
    </dependency> 
    </dependencies> 

    <build> 
    <resources> 
     <resource> 
     <directory>src/main/resources</directory> 
     <filtering>true</filtering> 
     </resource> 
    </resources> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-jar-plugin</artifactId> 
     <configuration> 
      <excludes> 
      <exclude>config/application.properties</exclude> 
      </excludes> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 

</project> 
+0

顯示你的pom.xml –

+0

我剛剛下載了'spring-ws-core-2.4.0.RELEASE.jar'文件,它包含'org/springframework/ws/server/endpoint/adapter/method/MethodReturnValueHandler .class'文件。也許你的文件被錯誤地下載了? – Andreas

+0

@Andreas它也存在於我的依賴關係中,但它並沒有從類路徑中被挑選出來。 –

回答

0

如果您的公司政策不阻止您定義<parent>那麼你可以添加:

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.5.3.RELEASE</version> 
</parent> 

的影響將是你的POM將會有一個父spring-boot-starter-parent其中引用定義公共依賴的spring-boot-dependencies和他們的相關版本。

所以下面會自動爲你添加:

 <dependency> 
      <groupId>org.springframework.ws</groupId> 
      <artifactId>spring-ws-core</artifactId> 
      <version>${spring-ws.version}</version> 
      <exclusions> 
       <exclusion> 
        <groupId>commons-logging</groupId> 
        <artifactId>commons-logging</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 

其中spring-ws.version被定義爲:

<properties> 
    ... 
    <spring-ws.version>2.4.0.RELEASE</spring-ws.version> 
    ... 
</properties> 

文檔:可用here

如果您不允許設置<parent>,那麼您可以按照these instructions