V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
evilmiracle
V2EX  ›  问与答

spring-data-examples 如何通过 maven 升级 lib 库啊?

  •  
  •   evilmiracle · 2018-04-14 17:59:11 +08:00 · 1285 次点击
    这是一个创建于 2176 天前的主题,其中的信息可能已经有所发展或是发生改变。

    发现 pom.xml 并没有细分第三方库的版本啊,不知道怎么升级 spring core 版本。。

    <project xmlns="&lt;a href=" http:="" maven.apache.org="" POM="" 4.0.0"="" rel="nofollow">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>

    <groupId>org.springframework.data.examples</groupId>
    <artifactId>spring-data-examples</artifactId>
    <version>2.0.0.BUILD-SNAPSHOT</version>
    <packaging>pom</packaging>
    
    <name>Spring Data - Examples</name>
    
    <parent>
    	<groupId>org.springframework.boot</groupId>
    	<artifactId>spring-boot-starter-parent</artifactId>
    	<version>2.0.0.RELEASE</version>
    </parent>
    
    <modules>
    	<module>bom</module>
    	<module>cassandra</module>
    	<module>couchbase</module>
    	<module>elasticsearch</module>
    	<module>jdbc</module>
    	<module>jpa</module>
    	<module>ldap</module>
    	<module>map</module>
    	<module>mongodb</module>
    	<module>multi-store</module>
    	<module>neo4j</module>
    	<module>rest</module>
    	<module>redis</module>
    	<module>solr</module>
    	<module>web</module>
    </modules>
    
    <properties>
    	<apt.version>1.1.3</apt.version>
    </properties>
    
    <profiles>
    	<profile>
    		<id>spring-data-next</id>
    		<properties>
    			<spring-data-releasetrain.version>Kay-BUILD-SNAPSHOT</spring-data-releasetrain.version>
    		</properties>
    	</profile>
    	<profile>
    		<id>spring-data-next-releasetrain</id>
    		<properties>
    			<spring-data-releasetrain.version>Lovelace-BUILD-SNAPSHOT</spring-data-releasetrain.version>
    		</properties>
    	</profile>
    	<profile>
    		<id>spring-data-next-releasetrain-released</id>
    		<properties>
    			<spring-data-releasetrain.version>Lovelace-M1</spring-data-releasetrain.version>
    		</properties>
    	</profile>
    </profiles>
    
    <developers>
    	<developer>
    		<id>ogierke</id>
    		<name>Oliver Gierke</name>
    		<email>[email protected]</email>
    	</developer>
    	<developer>
    		<id>tdarimont</id>
    		<name>Thomas Darimont</name>
    		<email>[email protected]</email>
    	</developer>
    	<developer>
    		<id>cstrobl</id>
    		<name>Christoph Strobl</name>
    		<email>[email protected]</email>
    	</developer>
    	<developer>
    		<id>gturnquist</id>
    		<name>Greg Turnquist</name>
    		<email>[email protected]</email>
    	</developer>
    	<developer>
    		<id>mpaluch</id>
    		<name>Mark Paluch</name>
    		<email>[email protected]</email>
    	</developer>
    	<developer>
    		<id>jschauder</id>
    		<name>Jens Schauder</name>
    		<email>[email protected]</email>
    	</developer>
    </developers>
    
    <dependencies>
    
    	<dependency>
    		<groupId>org.projectlombok</groupId>
    		<artifactId>lombok</artifactId>
    		<scope>provided</scope>
    	</dependency>
    
    	<dependency>
    		<groupId>org.springframework.boot</groupId>
    		<artifactId>spring-boot-devtools</artifactId>
    		<scope>provided</scope>
    	</dependency>
    
    	<!-- Test dependencies -->
    
    	<dependency>
    		<groupId>org.springframework.boot</groupId>
    		<artifactId>spring-boot-starter-test</artifactId>
    		<scope>test</scope>
    	</dependency>
    
    </dependencies>
    
    <repositories>
    	<repository>
    		<id>spring-libs-snapshot</id>
    		<url>https://repo.spring.io/libs-snapshot</url>
    	</repository>
    </repositories>
    
    <pluginRepositories>
    	<pluginRepository>
    		<id>spring-libs-snapshot</id>
    		<url>https://repo.spring.io/libs-snapshot</url>
    	</pluginRepository>
    </pluginRepositories>
    
    </project>

    这是默认的 pom.xml

    然后 spring 的版本是 5.0.4

    我现在想升级到 spring 5.0.5,要怎么做?

    3 条回复    2018-04-14 19:31:25 +08:00
    honeycomb
        1
    honeycomb  
       2018-04-14 18:09:00 +08:00 via Android
    这里的版本号是由 springboot starter 的各个包管理的(包括 springboot parent )
    可以 override,即手动指定某个 artifact 的版本号。
    CFO
        2
    CFO  
       2018-04-14 18:09:49 +08:00 via Android
    parent 里面有大部分的
    acrisliu
        3
    acrisliu  
       2018-04-14 19:31:25 +08:00
    加入 spring-core 5.0.5 的 dependency 就行。
    不过建议除非有重大 BUG,否则还是由 spring boot parent 统一管理依赖版本。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2841 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:21 · PVG 21:21 · LAX 06:21 · JFK 09:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.