I think Ladlestein is certainly on the right track, but I can add a little more context to this problem in how I was able to reproduce it:
I have a similar Eclipse (Indigo) setup in which I have a Maven project and use the Eclipse Wcl function to deploy to the Tomcat 7 embedded server. Everything works fine if I import the project as a Maven project from Eclipse, but my problem arises, when I execute the mvn eclipse:clean and mvn eclipse:eclipse commands from the command line. This of course restores the Eclipse .project file, but leaves it without any explicitly important Natures and buildCommands.
I am observing a .project file very similar to the wrong one in the question (in myproject2), and in Eclipse the project is no longer what Eclipse calls the โdynamic web moduleโ, therefore it is not deployed - and it is not a longer Maven project . I was able to fix this as follows:
First make a Maven project by adding the following to your .project file (I don't know if there is a better way through Eclipse):
<buildSpec> ... ... <buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> </buildCommand> </buildSpec> <natures> ... ... <nature>org.eclipse.m2e.core.maven2Nature</nature> </natures>
Now you can verify that the project has been updated by right-clicking on the project and launching Maven > Update Project Configuration...
Then you can make the project deployable using Properties > Project Facets > Dynamic Web Module (checkbox). Below is a complete complete set of instructions for creating your dynamic web module project .
At the end, your .project file should look something like this:
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>project1</name> <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> </natures> </projectDescription>
source share