在父pom中配置如下
都是Spring 官网中的较GA新版本
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>Cairo-SR7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Greenwich.SR1</version>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
在执行mvn clean install的时候,会抛出如下错误
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for org.springframework.session:spring-session:jar is missing. @ com.learn.security:learn-security-browser:[unknown-version], F:\luzongzhu\personal\learn\Security\learn-security-browser\
pom.xml, line 22, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-oauth2:jar is missing. @ com.learn.security:learn-security-core:[unknown-version], F:\luzongzhu\personal\learn\Security\learn-security-
core\pom.xml, line 17, column 21
@
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR] The project com.learn.security:learn-security-browser:1.0-SNAPSHOT (F:\luzongzhu\personal\learn\Security\learn-security-browser\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.springframework.session:spring-session:jar is missing. @ com.learn.security:learn-security-browser:[unknown-version], F:\luzongzhu\personal\learn\Security\learn-security-brow
ser\pom.xml, line 22, column 21
[ERROR]
[ERROR] The project com.learn.security:learn-security-core:1.0-SNAPSHOT (F:\luzongzhu\personal\learn\Security\learn-security-core\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-oauth2:jar is missing. @ com.learn.security:learn-security-core:[unknown-version], F:\luzongzhu\personal\learn\Security\learn-secur
ity-core\pom.xml, line 17, column 21
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
F:\luzongzhu\personal\learn\Security\learn-security>mvn clean install
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-oauth2:jar is missing. @ com.learn.security:learn-security-core:[unknown-version], F:\luzongzhu\personal\learn\Security\learn-security-
core\pom.xml, line 17, column 21
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.learn.security:learn-security-core:1.0-SNAPSHOT (F:\luzongzhu\personal\learn\Security\learn-security-core\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-oauth2:jar is missing. @ com.learn.security:learn-security-core:[unknown-version], F:\luzongzhu\personal\learn\Security\learn-secur
ity-core\pom.xml, line 17, column 21
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
错误指向的子pom.xml文件如下:
<dependencies>
<dependency>
<groupId>com.learn.security</groupId>
<artifactId>learn-security-core</artifactId>
<version>${learn.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session</artifactId>
</dependency>
</dependencies>
我看了下Spring官网的cloud版本,G这个版本应该是2.0的 应该兼容之前的才对,所以想请问下老师这是为什么。
Spring Security技术栈,REST风格开发常见接口,独立开发认证授权模块保证REST服务安全
了解课程