Idea Intellij中的springframework源 [英] springframework source in Idea Intellij

查看:415
本文介绍了Idea Intellij中的springframework源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难在Intellij中设置springframework代码.

I'm having hard time to setup springframework code in Intellij.

我从git克隆了github的springframework项目,并执行了ant任务,将所有库放入ivy-cache目录. 我为intellij项目找到了"spring-framework.ipr"文件,并打开了它. 不幸的是,某些库未正确映射到jar文件或丢失.因此,我无法在IDE中编译代码库.

I git-cloned springframework project from github, and ran ant task to get all the libraries into ivy-cache directory. I found "spring-framework.ipr" file for intellij project, and opened it. Unfortunately, some of the libraries are not correctly mapped to the jar files or missing. So I cannot compile the codebase in IDE.

我还尝试将eclipse项目导入intellij. Jar文件引用似乎还可以. 但是OXM模块中存在编译错误.一些测试类引用了自动生成的类,例如〜.samples.flight.FlightDocument",〜.jaxb.test.FlightType",但它们不存在(测试目标会在目标目录中生成它们). 似乎在STS中也会发生同样的问题.

I also tried importing as eclipse project into intellij. Jar file reference seems ok. But there are compilation errors in OXM module. Some test classes have reference to auto generated classes such as "~.samples.flight.FlightDocument", "~.jaxb.test.FlightType", and they don't exist(ant test goal generates them in target dir). It seems same problem happens in STS.

我引用了此博客文章: http://blog.springsource.org/2009/03/03/building-spring-3/

I referenced this blog post: http://blog.springsource.org/2009/03/03/building-spring-3/

在intellij中设置spring代码的好主意吗?
我使用的是intellij v11.

Any good idea to setup spring code in intellij?
I use intellij v11.

git分支:3.1.x
git commit:e8fc90ce3e4554f14eaa86ce05591249d3fe62fa

git branch: 3.1.x
git commit: e8fc90ce3e4554f14eaa86ce05591249d3fe62fa

编译错误示例:

.../org.springframework.oxm/src/test/java/org/springframework/oxm/xmlbeans/XmlBeansMarshaller Tests.java

Error:(29,42) package org.springframework.samples.flight does not exist
Error:(30,42) package org.springframework.samples.flight does not exist
Error:(44,9) cannot find symbol class FlightsDocument
Error:(44,58) package FlightsDocument does not exist
....

谢谢

推荐答案

问题已解决.

"spring-framework.ipr"是intellij的一个.

"spring-framework.ipr" is the one for intellij.

经验教训:

  • spring-framework.ipr文件中引用的junit版本完全错误.
  • 当蚂蚁构建在测试中失败时,将不会构建后续模块.因此,所需的库将不会下载到ivy-cache/存储库中.
  • 蚂蚁罐"目标将不会下载与测试相关的库,因为该目标不会运行测试

在所有测试通过并手动修复了junit参考之后,intellij最终没有错误.

After all the tests passed and manually fixed junit reference, intellij finally has no errors.

这篇关于Idea Intellij中的springframework源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆