maven project 转化为eclipse project

There is actually a very easy solution for this. The mavenS W "eclipse:eclipse" goal will download any necessary dependencies and will update our project's .classpath to include these dependencies. The maven command using the eclipse:eclipse goal would be

mvn eclipse:eclipse

导入到eclipse ide后,项目有个红色的感叹号,看起来很碍眼。原因在于java bulid path出问题。

 

The maven eclipseS W plugin requires an M2_REPO classpathW variable. This variable needs to point to the local maven repository. On my machine, this is located at C:\dev\m2repo. I went to Window → Preferences and JavaS W → Build Path → Classpath Variables. I clicked the New button and created the M2_REPO classpath variable and pointed it to my local maven repository.

 

生成的eclipse项目的配置文件.classpath 中如下一段代码:

 

<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>

 所以有了上面提到配置变量M2_REPO.才能找到这个junit包。这个版本是不是太低了?修改pom.xml可以以高版本覆盖之。

 

至此,

 

参考文档:

 

http://www.avajava.com/tutorials/lessons/how-do-i-import-a-maven-project-into-eclipse.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值