用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. Redis高级应用——2

    Redis-事务 Redis 事务可以一次执行多个命令, 并且带有以下两个重要的保证: 事务是一个单独的隔离操作,事务中的所有命令都会序列化.按顺序地执行.事务在执行的过程中,不会被其他客户端发送来的 ...

  2. Scala中的类学习

    Scala中的类学习 从java了解类的情况下,了解Scala的类并不难.Scala类中的字段自动带getter和setter方法,用@BeanProperty注解生成javaBean对象的getXX ...

  3. springboot快速入门(五)——事务管理

    一.入门 概念就不再赘述了,由于一般我们是通过service控制事务,这里给出注解式的示例: package com.example.demo; import com.example.demo.bea ...

  4. mfc 类对象的引用

    类对象引用 自写复制构造函数 一. 类对象引用 在第4课的时候,我们已经讨论过C++引用特性.类变量的引用呢,实际上也是类似的. Tdate d1; Tdate &d2=d1; 二.自写复制构 ...

  5. codeforces 1053D 树形DP

    题意:给一颗树,1为根节点,有两种节点,min或者max,min节点的值是它的子节点的值中最小的,max节点的值是它的子节点的值中最大的,若共有k个叶子,叶子的值依次为1~k. 问给每个叶子的值赋为几 ...

  6. HDU - 3874 Necklace (树状数组、离线处理)

    题目链接:Necklace 题意: 给出一串珠子,每个珠子有它的value,现在给出n(n<=5e4)个珠子的value(1<=value<=1e6),现在给出m(1<=m&l ...

  7. android targetSdkVersion>=26收不到广播的处理

    背景:GP新政策,要求Google Player上架应用的targetSdkVersion>=26. 一. 为啥GP要求targetSdkVersion>=26? 1 targetSdkV ...

  8. Struts 2 访问Servlet API的方式

    与Servlet API解耦的访问方式 与Servlet API耦合的访问方式 (tips:耦合既依赖) 1.    与Servlet API解耦的访问方式 2.     与Servlet API耦合 ...

  9. Maven+spring+springMVC+mybatis+Junit+Log4j配置个人总结

          首先粘贴上项目引用地址:http://doc.okbase.net/fengshizty/archive/126397.html 这里对创建步骤不做过多解释,只是针对案例创建demo的一些 ...

  10. 干货分享:五大最适合学习AI开发的编程语言

    AI(人工智能)为应用开发者开创了一个全新的可能性.通过利用机器学习或深度学习,您可以生成更好的用户配置文件.个性化设置和推荐,或者整合更智能的搜索.语音界面或智能助手,或者以其他数种方式改进您的应用 ...