Search code examples
javaeclipsemaven-2tomcatm2eclipse

eclipse: Run on server disappear


I have a maven project created with maven-archetype-webapp. As i use on Windows machine, the project generated by Maven has a "Run on Server" but when i create it on Linux machine, it doesnt have. Please tell me how can i enable it.

Thanks


Solution

  • I have the same problem. I think it is a bug in the M2Eclipse plugin that often appears (but I still don't know what are the conditions of this bug).

    When M2Eclipse creates the Eclipse project, it doesn't associate the project with the "web nature". I have a solution, which is not very clean but it works.

    1. Create your Maven webapp project
    2. Create an Eclipse Dynamic web project
    3. Fusion the eclipse config files (.project, .classpath and the .settings directory) in the Maven project. The web nature will be added to your project and the "Run on server" option will appear.

    PS: after updating the config files, you'll have to close/open your project to update the configuration.

    If someone has a better solution, I am interested too !