Oauth2 示例因依赖项错误而无法正常工作
Oauth2 samples not working because dependency error
我已经从 GitHub 下载 spring-security-oauth Maven 项目,其中包含示例 tonr2
和 spaklr2
。
在所有 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>
在下面的依赖项中显示错误。
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>${project.version}</version>
</dependency>
错误是:
Missing artifact org.springframework.security.oauth:spring-security-oauth2:jar:2.0.8.BUILD-SNAPSHOT
在 运行 命令之后
mvn install -P bootstrap
我遇到下一个错误:
[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
要构建spring-security-oauth项目,您首先需要运行以下命令:
mvn clean install -P bootstrap -DskipTests=true
您可以直接在命令行上运行它(这是简单的解决方案)。
如果您想直接在 Eclipse 中执行此操作,则需要创建自定义 Maven 构建。进入"Run > Run Configurations..."。双击 "Maven Build" 创建一个新的自定义 Maven 构建。给它起个名字,select 基本目录到你要构建的项目的工作目录,select 目标 "clean install" 和配置文件 "bootstrap".
第一次构建完成后,在Eclipse中更新Maven项目,就不会再有任何错误了。
我已经从 GitHub 下载 spring-security-oauth Maven 项目,其中包含示例 tonr2
和 spaklr2
。
在所有 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>
在下面的依赖项中显示错误。
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>${project.version}</version>
</dependency>
错误是:
Missing artifact org.springframework.security.oauth:spring-security-oauth2:jar:2.0.8.BUILD-SNAPSHOT
在 运行 命令之后
mvn install -P bootstrap
我遇到下一个错误:
[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
要构建spring-security-oauth项目,您首先需要运行以下命令:
mvn clean install -P bootstrap -DskipTests=true
您可以直接在命令行上运行它(这是简单的解决方案)。
如果您想直接在 Eclipse 中执行此操作,则需要创建自定义 Maven 构建。进入"Run > Run Configurations..."。双击 "Maven Build" 创建一个新的自定义 Maven 构建。给它起个名字,select 基本目录到你要构建的项目的工作目录,select 目标 "clean install" 和配置文件 "bootstrap".
第一次构建完成后,在Eclipse中更新Maven项目,就不会再有任何错误了。