views:

54

answers:

2

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

+4  A: 

Does that other eclipse has the WTP plugin installed?
As this page on WTP-Maven integration illustrates, WTP is needed for running on a server.

See also "Maven Integration for Eclipse/ Integration with WTP / WTP mini howto"

alt text

If you have WTP on the other eclipse, check other causes in this SO question.

VonC
yes, i use the eclipse for javaee so WTP is installed. I created a server as well. 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.
robinmag
WTP is installed... But is M2Eclipse WTP plugin installed ? After installing M2Eclipse, the WTP plugin of M2Eclipse is on another update site (M2Eclipse Extras). It is probably a common mistake : installing M2Eclipse but forgetting its plugins.
Benoit Courtine
+2  A: 

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 !

Benoit Courtine
Interesting workaround, much more practical than my general answer. +1
VonC