maven-archetype-webapp eclipse problem
Solution 1:
Simply create a java
directory under main
(i.e. src/main/java
) and right-click on your project and select Maven > Update Project Configuration.
Solution 2:
- By default, When you create a project with maven archetype "maven-archetype-webapp", it doesn't create any java and test folders.
- You can manually add those folders as src/main/java and src/test/java.
- After adding these folders, right click on your project in project explorer, go to maven>update project conf.
Solution 3:
Simply create a java directory under main (i.e. src/main/java) and right-click -> Build Path -> Use a Source Folder
Solution 4:
- Read the m2eclipse WTP mini-howto.
- Check the online Developing with Eclipse and Maven.
- Ensure your settings.xml is configured in the Eclipse preferences.
- Check the m2eclipse FAQ.
Anything else is likely to be down to the archetype and how you've configured your pom.xml
. The directory structure you describe is identical to the one maven-archetype-webapp
creates on the command line.
Solution 5:
This is a great article that I read when I was having trouble understanding how to build multiple projects into one using Maven. Specifically, this article explains how to set up a WEB project (war file) to consume an inner standard java project (jar file).
If you have a basic understanding of Maven, skip to the sections at the end: How do I build other types of projects? How do I build more than one project at once?
http://maven.apache.org/guides/getting-started/index.html#How_do_I_build_other_types_of_projects
If you aren't familiar with Maven yet, check out:
http://www.mkyong.com/spring/quick-start-maven-spring-example/
Trust me, mkyong knows what is up!