无法访问spring boot starter父依赖项

vybvopom  于 2021-07-24  发布在  Java
关注(0)|答案(1)|浏览(489)

我在用https://start.spring.io/ 要创建spring boot项目并在开发中使用,我无法访问spring boot启动程序这些依赖项:

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-support</artifactId>
        <version>3.0.10.RELEASE</version>
</dependency>

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-oxm</artifactId>
        <version>5.3.2</version>
</dependency>

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
        <version>4.5.13</version>
</dependency>

<dependency>
    <groupId>com.sun.xml.messaging.saaj</groupId>
    <artifactId>saaj-impl</artifactId>
        <version>1.5.2</version>
</dependency>

我收到警告信息:

Overriding managed version 5.3.1 for spring-oxm
Overriding managed version 5.3.1 for spring-oxm
Duplicating managed version 4.5.13 for httpclient
Duplicating managed version 1.5.2 for saaj-impl

我一直在寻找如何修复它,一些人提到的解决方法之一就是使用 <!--$NO-MVN-MAN-VER$ --> 在比赛结束时 </version> 标记以忽略警告。
我的问题是如何从springboot中看到这些(以及其他将来的依赖关系)?
编辑#1: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>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.0</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>xx.xx.xxx</groupId>
    <artifactId>yyyy</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>yyyy</name>
    <description>zzzzz</description>

    <properties>
        <java.version>11</java.version>

        <apache.cxf.version>3.4.1</apache.cxf.version>
        <apache.httpcomponents.version>4.5.13</apache.httpcomponents.version>
        <jaxb2.maven2.version>0.14.0</jaxb2.maven2.version>

        <springframework.version>5.3.2</springframework.version>
        <springframework.ws.version>3.0.10.RELEASE</springframework.ws.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</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-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${apache.cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>${jaxb2.maven2.version}</version>
            <type>maven-plugin</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.ws</groupId>
            <artifactId>spring-ws-support</artifactId>
            <version>${springframework.ws.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${apache.httpcomponents.version}</version>
        </dependency>
    </dependencies>
</project>
3qpi33ja

3qpi33ja1#

解决方法是移除 <version>...</version> ,让spring引导处理版本。
多亏了戴维斯。

相关问题