我看了一下文档Build from Source。我克隆了存储库,签出了master并尝试通过执行来构建项目
$ ./gradlew build
但是我出错了
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/5.6.4/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Task :spring-aspects:compileAspectj FAILED
[warning] couldn't find aspectjrt.jar on classpath, checked: C:\Program Files\Java\jdk1.8.0_212\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_212\jre\classes;E:\git\spring-framework\spring-orm\build\libs\spring-orm-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-jdbc\build\libs\spring-jdbc-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-tx\build\libs\spring-tx-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-beans\build\libs\spring-beans-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-core\build\libs\spring-core-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-core\build\libs\spring-cglib-repack-3.3.0.jar;E:\git\spring-framework\spring-core\build\libs\spring-objenesis-repack-3.1.jar;E:\git\spring-framework\spring-jcl\build\libs\spring-jcl-5.2.2.BUILD-SNAPSHOT.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_212\jre\lib\ext\zipfs.jar;E:\git\spring-framework\spring-orm\build\libs\spring-orm-5.2.2.BUILD-SNAPSHOT.jar;C:\Users\Витек\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.4\9205229878f3d62fbd3a32a0fb6be2d6ad8589a9\aspectjweaver-1.9.4.jar;C:\Users\Витек\.gradle\caches\modules-2\files-2.1\com.google.code.findbugs\jsr305\3.0.2\25ea2e8b0c338a877313bd4672d3fe056ea78f0d\jsr305-3.0.2.jar;C:\Users\Витек\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjrt\1.9.4\7efb30f3259d13472ee0f92bef4319fda700f522\aspectjrt-1.9.4.jar;E:\git\spring-framework\spring-jdbc\build\libs\spring-jdbc-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-tx\build\libs\spring-tx-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-beans\build\libs\spring-beans-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-core\build\libs\spring-core-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-core\build\libs\spring-cglib-repack-3.3.0.jar;E:\git\spring-framework\spring-core\build\libs\spring-objenesis-repack-3.1.jar;E:\git\spring-framework\spring-jcl\build\libs\spring-jcl-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-context-support\build\libs\spring-context-support-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-context\build\libs\spring-context-5.2.2.BUILD-SNAPSHOT.jar;E:\git\spring-framework\spring-aop\build\libs\spring-aop-5.2.2.BUILD-SNAPSHOT.jar;C:\Users\Витек\.gradle\caches\modules-2\files-2.1\javax.cache\cache-api\1.1.0\77bdcff7814076dfa61611b0db88487c515150b6\cache-api-1.1.0.jar;C:\Users\Витек\.gradle\caches\modules-2\files-2.1\javax.transaction\javax.transaction-api\1.3\e006adf5cf3cca2181d16bd640ecb80148ec0fce\javax.transaction-api-1.3.jar;E:\git\spring-framework\spring-expression\build\libs\spring-expression-5.2.2.BUILD-SNAPSHOT.jar
[error] classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath)
1 error, 1 warning
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':spring-aspects:compileAspectj'.
> Compilation failed with exit code 1; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 0s
133 actionable tasks: 5 executed, 128 up-to-date
但是当我排除弹簧方面的任务时,构建就可以了
$ ./gradlew -x :spring-aspects:compileAspectj -x :spring-aspects:compileTestAspectj build
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: http/docs.gradle.org/5.6.4/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
BUILD SUCCESSFUL in 5m 25s
200 actionable tasks: 5 executed, 195 up-to-date
Intellij IDEA配置doc包含信息
- 出现提示时,排除
spring-aspects
模块(或在通过File-> Project Structure-> Modules导入之后)
Build from Source文档应被更新还是存在其他问题?
答案 0 :(得分:0)
将GRADLE_USER_HOME env变量设置为path,仅包含ascii字符修复问题
$ GRADLE_USER_HOME=/e/.gradle ./gradlew build
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
BUILD SUCCESSFUL in 4m 25s
203 actionable tasks: 4 executed, 199 up-to-date