gpt4 book ai didi

java - 构建具有 Spring 框架依赖项的发行版

转载 作者:太空宇宙 更新时间:2023-11-04 14:39:39 27 4
gpt4 key购买 nike

我正在学习Spring开发,并尝试按照Github上的一个项目(网站是:https://github.com/spring-projects/spring-framework/wiki/Building-a-distribution-with-dependencies)一步步配置Spring框架。输入命令 $ ./gradlew depsZip运行 depsZip gradle 任务 。显示以下信息但失败:

:spring-aspects:compileJava
Download http://repo.springsource.org/libs-release/org/aspectj/aspectjrt/1.7.1/a
spectjrt-1.7.1.jar
[ant:iajc] C:\Users\Zihan\Documents\GitHub\spring-framework\spring-aspects\src\m
ain\java\org\springframework\beans\factory\aspectj\AbstractBeanConfigurerAspect.
aj:1 [error] The type java.lang.CharSequence cannot be resolved. It is indirectl
y referenced from required .class files
[ant:iajc] (no source information available)
[ant:iajc] C:\Users\Zihan\Documents\GitHub\spring-framework\spring-aspects\src\m
ain\java\org\springframework\mock\staticmock\AbstractMethodMockingControl.aj:19
[error] The import java.util.Arrays cannot be resolved
[ant:iajc] import java.util.Arrays;
[ant:iajc] ^^^^^^^^^^^^^^^
[ant:iajc] C:\Users\Zihan\Documents\GitHub\spring-framework\spring-aspects\src\m
ain\java\org\springframework\mock\staticmock\AbstractMethodMockingControl.aj:87
[error] Arrays cannot be resolved
[ant:iajc] if (!Arrays.equals(this.args, args)) {
[ant:iajc] ^
[ant:iajc]
[ant:iajc] 3 errors
:spring-aspects:compileJava FAILED

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\Zihan\Documents\GitHub\spring-framework\spring-aspects\aspects.
gradle' line: 30

* What went wrong:
Execution failed for task ':spring-aspects:compileJava'.
> compile errors: 3

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 42.798 secs
C:\Users\Zihan\Documents\GitHub\spring-framework [(abdcefb...)]>

可以帮我解决配置问题吗?如果给予一些指导,我真的很感激。

提前致谢!

最佳答案

首先,为什么不能使用maven或gradle这样的依赖管理工具?在你的链接中我读了

Although it is strongly recommended that Spring Framework users take advantage of the transitive dependency management features of build systems like Gradle, Maven, and Ivy, some teams cannot use these tools. This is usually due to corporate restrictions or working with legacy builds

使用上面定义的工具可以简单地构建和维护 Spring 项目。然后要开始一个 Spring 项目,您可以按照此 Building Spring Project 进行操作。

关于java - 构建具有 Spring 框架依赖项的发行版,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25091978/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com