Java web project created using Maven not recognized by Eclipse as such

I created a web project with maven as follows:

mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp

Then I launched mvn eclipse:eclipse so that the eclipse project is built. Eclipse recognizes all the functions of a project, but does not recognize it as a web project.

Therefore, when I create a server inside the eclipse workspace and go into the dialog where I choose which projects to deploy on my server, I am not prompted to deploy my newly created project.

Ideas?

+7
java eclipse maven servlets
source share
4 answers

Your pom.xml explicitly states that the maven-eclipse-plugin should generate a WTP project. A simple example that should be in your pom.xml in the assembly would be:

 <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <wtpmanifest>true</wtpmanifest> <wtpapplicationxml>true</wtpapplicationxml> <wtpversion>2.0</wtpversion> </configuration> </plugin> </plugins> 
+7
source share

You can also use mvn eclipse:eclipse -Dwtpversion=2.0 to generate all the WTP metadata for the project without changing the POM.

Of course you will have to change the version of WTP if you are using an older version of Eclipse.

+5
source share

Just install the m2eclipse development version, and your project will be used as a maven project, no need to do mvn eclipse: eclipse or something like that. I use it and work.

http://m2eclipse.sonatype.org/

+2
source share

Have you moved from the create command to the eclipse command: eclipse?

Check this link . You need to edit the POM first and then call "mvn clean package". After that, THEN try "mvn eclipse: eclipse".

0
source share

All Articles