如何在不升级spring-cloud-dependencie版本的情况下升级spring-cloud-starter-openfeign版本

时间:2019-11-28 02:55:13

标签: spring-cloud spring-cloud-feign

在我的springcloud项目中,我在pom.xml中定义了dependencyManagement。

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Finchley.SR2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

有一个问题,我想通过在SpringCloud中使用Feign使用DTO上传文件,所以我想将spring-cloud-openfeign.version中的feign-XX形式的9.x版本升级为10.x版本,我该如何解决?升级spring-cloud-openfeign.version中定义的spring-cloud-dependencies的版本?

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies-parent</artifactId>
        <version>2.0.4.RELEASE</version>
        <relativePath/>
    </parent>
    <artifactId>spring-cloud-dependencies</artifactId>
    <version>Finchley.SR2</version>
    <name>spring-cloud-dependencies</name>
    <description>Spring Cloud Dependencies</description>
    <packaging>pom</packaging>
    <properties>
        <main.basedir>${basedir}/../..</main.basedir>
        <spring-cloud-aws.version>2.0.1.RELEASE</spring-cloud-aws.version>
        <spring-cloud-bus.version>2.0.0.RELEASE</spring-cloud-bus.version>
        <spring-cloud-cloudfoundry.version>2.0.1.RELEASE</spring-cloud-cloudfoundry.version>
        <spring-cloud-commons.version>2.0.2.RELEASE</spring-cloud-commons.version>
        <spring-cloud-config.version>2.0.2.RELEASE</spring-cloud-config.version>
        <spring-cloud-consul.version>2.0.1.RELEASE</spring-cloud-consul.version>
        <spring-cloud-contract.version>2.0.2.RELEASE</spring-cloud-contract.version>
        <spring-cloud-function.version>1.0.0.RELEASE</spring-cloud-function.version>
        <spring-cloud-gateway.version>2.0.2.RELEASE</spring-cloud-gateway.version>
        <spring-cloud-netflix.version>2.0.2.RELEASE</spring-cloud-netflix.version>
        <spring-cloud-openfeign.version>2.0.2.RELEASE</spring-cloud-openfeign.version>
        <spring-cloud-security.version>2.0.1.RELEASE</spring-cloud-security.version>
        <spring-cloud-sleuth.version>2.0.2.RELEASE</spring-cloud-sleuth.version>
        <spring-cloud-stream.version>Elmhurst.SR1</spring-cloud-stream.version>
        <spring-cloud-task.version>2.0.0.RELEASE</spring-cloud-task.version>
        <spring-cloud-vault.version>2.0.2.RELEASE</spring-cloud-vault.version>
        <spring-cloud-zookeeper.version>2.0.0.RELEASE</spring-cloud-zookeeper.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <!-- bom dependencies at the bottom so they can be overridden above -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-commons-dependencies</artifactId>
                <version>${spring-cloud-commons.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix-dependencies</artifactId>
                <version>${spring-cloud-netflix.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-stream-dependencies</artifactId>
                <version>${spring-cloud-stream.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-task-dependencies</artifactId>
                <version>${spring-cloud-task.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-config-dependencies</artifactId>
                <version>${spring-cloud-config.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-function-dependencies</artifactId>
                <version>${spring-cloud-function.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-gateway-dependencies</artifactId>
                <version>${spring-cloud-gateway.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-consul-dependencies</artifactId>
                <version>${spring-cloud-consul.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-sleuth-dependencies</artifactId>
                <version>${spring-cloud-sleuth.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-vault-dependencies</artifactId>
                <version>${spring-cloud-vault.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-zookeeper-dependencies</artifactId>
                <version>${spring-cloud-zookeeper.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-security-dependencies</artifactId>
                <version>${spring-cloud-security.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-cloudfoundry-dependencies</artifactId>
                <version>${spring-cloud-cloudfoundry.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-bus-dependencies</artifactId>
                <version>${spring-cloud-bus.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-contract-dependencies</artifactId>
                <version>${spring-cloud-contract.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-aws-dependencies</artifactId>
                <version>${spring-cloud-aws.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-openfeign-dependencies</artifactId>
                <version>${spring-cloud-openfeign.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <profiles>
        <profile>
            <id>spring</id>
            <repositories>
                <repository>
                    <id>spring-snapshots</id>
                    <name>Spring Snapshots</name>
                    <url>https://repo.spring.io/libs-snapshot-local</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>spring-milestones</id>
                    <name>Spring Milestones</name>
                    <url>https://repo.spring.io/libs-milestone-local</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>spring-releases</id>
                    <name>Spring Releases</name>
                    <url>https://repo.spring.io/release</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>spring-snapshots</id>
                    <name>Spring Snapshots</name>
                    <url>https://repo.spring.io/libs-snapshot-local</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>spring-milestones</id>
                    <name>Spring Milestones</name>
                    <url>https://repo.spring.io/libs-milestone-local</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
</project>

1 个答案:

答案 0 :(得分:0)

已关闭,在Using Spring Boot without the Parent POM

中找到了解决方案