Maven項目pom文件覆蓋jar包版本

pom.xml中引入一下代碼會覆蓋引入jar的版本

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>xxx</groupId>
                <artifactId>xxx</artifactId>
                <version>xxx</version>
                <scope>xxx</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

比如需要在Springboot項目中使用spring-messaging 這個5.2.6.RELEASE版本的的jar信息。原來SpringBoot中已存在4.3.4這個版本。那麼我們只需要這麼做即可

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-messaging</artifactId>
                <version>5.2.6.RELEASE</version>
                <scope>compile</scope>
            </dependency>

        </dependencies>

    </dependencyManagement>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章