请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

老师您好,在搭建认证框架的时候使用较新版本的依赖会报错

在父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的 应该兼容之前的才对,所以想请问下老师这是为什么。

正在回答 回答被采纳积分+3

1回答

JoJo 2019-06-04 13:49:16

课程中使用的是Spring Boot 1.5,使用2.0版本可能会出现问题。还是用1.5版本的吧。

1 回复 有任何疑惑可以回复我~
  • 老师 后续会继续会把课程更新到 springboot 2.0 以上的吗 或者项目更新
    回复 有任何疑惑可以回复我~ 2019-06-15 15:33:08
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信