我试图从源代码构建1.0.1.RELEASE(从github抓取zip)。我遇到了以下错误。为了使构建成功,我编辑了依赖项并将commons-logging依赖项从test编译为compile,因此编译器可以找到Log。由于这是一个发布标记,我想知道是否实际上存在一个问题,实际上是我从标记的确切pom.xml构建它。
构建日志摘录:
[INFO] Compiling 98 source files to /Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.223s
[INFO] Finished at: Thu Jul 30 10:32:51 EDT 2015
[INFO] Final Memory: 13M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project spring-security-saml2-core: Compilation failure
[ERROR] /Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project spring-security-saml2-core: Compilation failure
/Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[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/MojoFailureException
依赖片段:
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency
答案 0 :(得分:1)
我也遇到了同样的问题,并将“公共日志记录”依赖的范围从测试更改为编译,问题已解决。 所以它似乎不是你的问题,而是pom文件。
答案 1 :(得分:0)
正确的构建方式是使用gradle,看起来你正在使用Maven?运行git clone git@github.com:spring-projects/spring-security-saml.git
,git checkout tags/rb.1.0.1.RELEASE
和gradlew build
。这在持续集成服务器和我的机器上运行良好。