myeclipse 导入 import maven web project



用google才收到了这个。。

http://stackoverflow.com/questions/12197662/maven-java-web-project-not-recognised-when-importing-into-eclipse

就是导入后  是普通的java项目,然后在   project factes  勾上Dynamic Web Module 选3.0   apply  就行了




 貌似要翻墙才能看  直接发把

A colleague is trying to import a Java web project project into his Eclipse workspace. He's installed the m2e plugin and it recognises the "parent" project and the 3 sub projects it has (which are also Maven projects). However when the projects are imported, Eclipse doesn't seem to recognise them as Java projects (it doesn't show the usual "Java Resources" and "Deployment Descriptor"). The only two things that appear in the Project Explorer are shown below:

screenshot

I've imported the same project using my version of Eclipse and it recognises that the project is a Java web project without any issues. Is there something he needs to do/install to get it to work? He has the Eclipse WTP as well as the m2e plugin, so I can't see any different between his Eclipse installation and mine.

share improve this question
 
 
as far as I know it is correct, as the main deployment descriptor would be inside src>main>webapp>web-inf –   Dhruvenkumar Shah  Aug 30 '12 at 13:23
 
@DhruvenkumarShah This is inside Eclipse's Project Explorer though, so there should be other items present such as "Deployed Resources" and "Javascript Resources" (among others) –   Closeratio  Aug 30 '12 at 15:33 
 
How does your colleague import the project? It should be imported as an existing maven project (File -> Import -> Maven -> Existing Maven Projects). –   yorkw  Aug 30 '12 at 21:39
1 
Just like that. It's strange because it detects the projects without any issues, but after importing them it doesn't seem to recognise that they're Java projects. –   Closeratio  Aug 31 '12 at 9:47

4 Answers

up vote 4 down vote accepted

As it turns out, we needed to enable project facets in the project properties. I'm not sure why this wasn't enabled by default like it was when it was imported into my Eclipse installation, but enabling the appropriate project facets fixed the issues we were having.

share improve this answer
 

You need to install m2eclipse-wtp 0.15.x (fromhttp://download.jboss.org/jbosstools/updates/m2eclipse-wtp/). It contains the necessary configurators to properly set the required project facets of Java EE projects, according to your pom.xml configuration.

Please note that m2eclipse-wtp is moving to the Eclipse foundation and is superceded by m2e-wtp. m2e-wtp 0.16.0 will be released on sept 28th 2012. Until then you can try playing with the latestrelease candidate

share improve this answer
 

Try selecting the project in the Package Explorer and performing Maven --> Update Project Configuration

share improve this answer
 

I experienced something like this once when I was using the "project explorer" view when I thought I was actually using the "package explorer" view. These two views will display your project differently.

share improve this answer


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值