Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Java web project created with Maven is not recognized as such by Eclipse

I created a web project with maven like this:

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

Then I run mvn eclipse:eclipse so that an eclipse project is built. Eclipse recognizes all the features of the project but it doesn't recognize it as a web project.

Therefore, when I create a server inside my eclipse workspace, and go to the dialog where I select what projects to deploy to my server, I am not offered to deploy my newly created project.

Ideas?

like image 502
flybywire Avatar asked Feb 02 '10 16:02

flybywire


1 Answers

You should explicitly mention in your pom.xml that the maven-eclipse-plugin should generate a WTP-project. A simple example, which should be in your pom.xml at the build-part, 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>
like image 111
Martin Sturm Avatar answered Nov 14 '22 22:11

Martin Sturm