用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  就行了

貌似要FQ才能看  直接发把

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:

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.

asked Aug 30 '12 at 13:11
Closeratio

190312
 
 
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

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.

answered Aug 31 '12 at 13:11
Closeratio

190312
 

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

answered Sep 14 '12 at 15:41
Fred Bricon

2,216719
 

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

answered Aug 30 '12 at 13:20
Chris Gerken

9,32651535
 

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.

answered Aug 30 '12 at 18:47
herrtim

1,031516


 

版权声明:本文为博主原创文章,未经博主允许不得转载。

myeclipse 导入 import maven web project的更多相关文章

  1. spring boot:创建一个简单的web(maven web project)

    1.新建一个maven web project; 2.在pom.xml文件中添加相应的依赖包: 3.新建一个HelloController请求控制类: 4.编写index.jsp页面: 5.编写启动类 ...

  2. maven web project打包为war包,目录结构的变化

    一个maven web project工程目录: 资源管理器中的目录层级如下: 导出为war包之后的目录层级为: 我们会发现,其实并没有如下的这些目录层级: 所以这两个目录层级只是IDE为我们添加的, ...

  3. 创建一个maven web project

    几经周折总算是找到了和高杨学长一样的web  project的方法.感谢学长的一语点醒.我之前以为,既是maven又是web project的项目得要是通过dynamic web project转换到 ...

  4. MyEclipse Web Project导入Eclipse Dynamic Web Project,无法部署到tomcat问 题

    做作业遇到一个小问题,将MyEclipse Web Project导入到Eclipse中开发.在部署到tomcat时,发现无法发布这个项目. 问题分析: MyEclipse Web Project被识 ...

  5. myeclipse下构建maven web项目

    首先创建一个Maven的Project如下图 我们勾选上Create a simple project (不使用骨架) 这里的Packing 选择 war的形式 由于packing是war包,那么下面 ...

  6. myeclipse 2014新建maven web 项目步骤

    首先在myeclipse中配置maven的安装路径: 在pom.xml中加上: 1 2 3 4 5 6 7 8 9 10  <plugins>           <plugin&g ...

  7. Maven Web Project设置Webcontent路径

    1,新建maven-archetype-webapp 2,右键项目-->Properties-->选中Project Facets中的Runtimes标签,然后Java版本改为1.8,Dy ...

  8. MyEclipse - 问题集 - maven update project 后,项目jdk的版本变化

    解决方法: 进入maven安装根目录,conf/settings.xml <profiles> <profile> <id>jdk-1.7</id> & ...

  9. myeclipse eclipse创建maven web项目时 index.jsp报错

    第一种办法 解决办法: ---------------------------------------------------------------------------------------- ...

随机推荐

  1. #leetcode刷题之路50-Pow(x, n)

    实现 pow(x, n) ,即计算 x 的 n 次幂函数.示例 1:输入: 2.00000, 10输出: 1024.00000示例 2:输入: 2.10000, 3输出: 9.26100 #inclu ...

  2. 树莓派3B+学习笔记:1、安装官方系统

    1.登录树莓派官方网站www.raspberrypi.org,点击Downloads: 2.点击NOOBS: 3.选择下载方式,可以选择下载BT种子或直接下载,这里我用迅雷直接下载,下载速度还是很快的 ...

  3. watir-webdriver 中根据html5中的data-*属性设置元素

    def jscript(key="",*hashdict) key_dict=hashdict[0].keys[0] value_dict=hashdict[0][key_dict ...

  4. This assembly may have been downloaded from the Web. ......

    错误消息例如: Error 6 Could not load the assembly file:///D:\me\Projects\DLL\Newtonsoft.Json\Portable40\Ne ...

  5. 9.22 下午 (document对象)

    document对象 1.找元素:(1)gerElementById()根据ID找   (2)gerElementByClassName()根据Class找,返回数组       (3)gerElem ...

  6. 5-[HTML]-body常用标签2

    1.表格标签 table 表格由<table> 标签来定义.每个表格均有若干行(由 <tr> 标签定义),每行被分割为若干单元格(由<td>标签定义).字母 td ...

  7. 1433: [ZJOI2009]假期的宿舍

    1433: [ZJOI2009]假期的宿舍 链接 分析: 直接网络流,看是否满足即可. S向每个有需要的人连边,有床的向T连边,认识的人之间互相连边. 代码: #include<cstdio&g ...

  8. python之打包、发布模块

    一.python中针对于写好的模块,并且比人也可以使用改模块,这样就可以以同意的打出来,让别人安装或者赋值过后可以更好的使用以及集成. 二.最近在学习python所以这里主要是记录一下python的打 ...

  9. 【POJ2832 】【Tyvj1460】【 7.22Test 】询问

    几种版本的题面 Description You are given an undirected graph G with N vertices and M edges. Each edge has a ...

  10. Cocos2DX开发:记录遇到的一些问题和解决方法

    今天看了一下以前学习cocos2dx时记录的一些笔记,主要是在实际中遇到的一些问题,整理了一下,就成为了这篇文章,便于自己以后查找,也为一些新手提供点经验. 这篇文章会一直更新,将自己之后开发中遇到的 ...