简体   繁体   English

由于依赖项错误,Oauth2示例无法正常工作

[英]Oauth2 samples not working because dependency error

I have downloaded spring-security-oauth Maven project from GitHub with the samples tonr2 and spaklr2 . 我已经从GitHub下载了spring-security-oauth Maven项目,并提供了示例tonr2spaklr2

I have been continously getting an error message in pom.xml after all the jar files are finished downloaded. 所有jar文件下载完毕后,我一直在pom.xml不断收到错误消息。

<parent>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth-parent</artifactId>
    <version>2.0.8.BUILD-SNAPSHOT</version>
    <relativePath>../../..</relativePath>
</parent>

It is showing an error in this below dependency. 在下面的依赖项中显示错误。

<dependency>
    <groupId>${project.groupId}</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>${project.version}</version>
</dependency>

The error is: 错误是:

Missing artifact org.springframework.security.oauth:spring-security-oauth2:jar:2.0.8.BUILD-SNAPSHOT 缺少工件org.springframework.security.oauth:spring-security-oauth2:jar:2.0.8.BUILD-SNAPSHOT

After run the command 运行命令后

mvn install -P bootstrap

I got the next error: 我收到下一个错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
12.4:test (default-test) on project spring-security-oauth2: There are test failu
res.
[ERROR]
[ERROR] Please refer to C:\Users\a.bazaldua.cerda\Desktop\Oauth\spring-security-
oauth-master\spring-security-oauth2\target\surefire-reports for the individual t
est results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption

To build spring-security-oauth project, you first need to run the following command: 要构建spring-security-oauth项目,首先需要运行以下命令:

mvn clean install -P bootstrap -DskipTests=true

You can run it directly on the command line (it is the easy solution). 您可以直接在命令行上运行它(这是简单的解决方案)。

If you want to do this directly in Eclipse, you will need to create a custom Maven Build. 如果要直接在Eclipse中执行此操作,则需要创建一个自定义Maven Build。 Go into "Run > Run Configurations...". 进入“运行>运行配置...”。 Double-click "Maven Build" to create a new custom Maven build. 双击“ Maven构建”以创建新的自定义Maven构建。 Give it a name, select the base directory to the working directory of the project you are trying to build, select the goals "clean install" and the profiles "bootstrap". 给它起一个名字,选择您要构建的项目的工作目录的基本目录,选择目标“全新安装”和配置文件“ bootstrap”。

After the first build is done, update the Maven project in Eclipse and you will no longer have any errors. 完成第一个构建后,在Eclipse中更新Maven项目,您将不再有任何错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM