spring - 使用gradle构建spring时出现编译错误

标签 spring build gradle

我正在通过使用 git 下载 spring 源来学习使用 Spring 和 gradle。我已经使用它下载了 git 克隆 git://github.com/SpringSource/spring-framework.git 我还在本地设置了 gradle。

当我尝试执行时

梯度构建

我收到如下编译错误:

C:\Users\mahendran\spring-framework>gradle build
:spring-core:asmRepackJar
:spring-core:cglibRepackJar
:spring-core:compileJava
C:\Users\mahendran\spring-framework\spring-core\src\main\java\org\springframework\util\xml\StaxUtils.java:318: 
cannot find symbol symbol : method newFactory()
location: class javax.xml.stream.XMLEventFactory
            return new XMLEventStreamWriter(eventWriter, XMLEventFactory.newFactory());
                                                                        ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:spring-core:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spring-core:compileJava'.
Compilation failed; 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.

BUILD FAILED

Total time: 1 mins 5.58 secs

最佳答案

这看起来像是版本偏差 - 我认为您需要更新 JDK。 AFAICT,newFactory() 是在 JDK6 版本 1.6.0.18 中添加的。

关于spring - 使用gradle构建spring时出现编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13022820/

相关文章:

java - 使用两个不同的上下文开发 Spring Web 应用程序

当文件位于不同的文件夹中时无法创建项目

gradle - 如何在手动测试中生成jacoco覆盖率?

java - 如何编写测试以便 Controller 可以连接到 API?

java - 如何在自定义 Velocity 工具中加载/访问 bean (@Resource)

visual-studio-2010 - 如何阻止 Visual Studio 构建未更改的依赖项?

java - 如何管理多个 Android 库项目的公共(public)依赖项?

android - 集成 Firebase Crashlytics 后生成签名 APK 时出错

java - 升级后 Eclipse "Unable to instantiate class JavaSourceLookupDirector, Expecting stackmap frame at branch target 53"

jquery - 无法使用 grunt 构建 jquery - 子模块错误