Until now I was using Eclipse Indigo and m2eclipse. When wanted to create a new project I chose new maven project > skip archetype selection > gave names > finish.
This would result in a directory structure like : src/main/java src/main/resources src/test/java src/test/resources
and with the directory src/main/webapp including META-INF --MANIFEST.MF WEB-INF --web.xml
Recently (yesterday) I switched to the Eclipse Kepler. Maven is integrated, thus I didn't download m2eclipse wtp.
When I tried new project > maven project > skip archetype > naming > war packaging > finish , I got the correct structure in the src directory src/main/java src/main/resources src/test/java src/test/resources
But the directory webapp, was empty! META-INF and WEB-INF did not exist, no web.xml also. I read about using the maven-archetype-webapp, but i got the error: "Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\stef.m2\repository)"
With this article Failed to resolve version for org.apache.maven.archetypes
I found out that I had to add the remote maven catalog. I did and was able to create a project using the maven-archetype-webapp version 1.0 . But then the problem was that the directory structure in the new project was:
Java Resources --src/main/resources
and src/main/webapp --index.jsp --WEB-INF |--web.xml
I expected(and wanted) the old directory structure which was , src/main/java src/main/resources src/test/java src/test/resources
and with the directory src/main/webapp including META-INF --MANIFEST.MF WEB-INF --web.xml
Is there a step I am missinng? something changed in archetypes? Maybe it is a really stupid question, but my research returned very little results. Please feel free to any comment that can get me and other with the same issue, back in track
Thanks!
After struggling about what was going on the archetype and for what reason it didn't create the usual structure...I decided -as a productivity workaround- to create a new maven project and skip archetype creation. After that I copied from an old project the directories of META-INF and WEB-INF and everything is working fine. I suggest if anyone reaches this point to just do the same in order to get going and not waste anymore time.
If someone knows the solution I will be more than welcome to read it :)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments