I\'m trying to create a very simple webapp with maven and eclipse, but I\'m having no joy at all, in fact the reverse of joy.
I go to File -> New Project, select Mav
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!
Do it the other way around. First make a webapp project, then add the Maven framework (in Intellij - right click project and select Add framework support). It will create the right folders for you.
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.
a webapp structure gets generated but with no 'java' directory under main
Create src/main/java on your own.
furthermore, there seems to be no compilation of it by java. I can make stupid errors and no syntax highlighting comes up. It's like java isn't recognizing it.
after creating appropriate dir structure execute the maven command
mvn eclipse:eclipse
then refresh the project in eclipse.
-SE
I had the same problem even when i added JRE system library to my current java version but still had same problem then i just deleted JRE system library and added once again it worked for me
To delete JRE System Library right click on project ->properties ->java build path -> select JRE system library -> remove
To add JRE go to properties->java build path -> add library ->JRE system library -> choose JRE -> finish
Simply create a java directory under main (i.e. src/main/java) and right-click -> Build Path -> Use a Source Folder