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

时间:2012-10-23 02:45:01

标签: spring build gradle

我正在学习使用Spring并使用git下载spring源代码。我已经下载了它      git clone git://github.com/SpringSource/spring-framework.git 我也在当地设置了gradle。

我正在尝试执行

gradle build

我收到编译错误如下:

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

1 个答案:

答案 0 :(得分:2)

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