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
Just add a new folder "java" under src/main. will solve the problem. Because the classpath with java folder is already available in .classpath file of created project, so adding java folder will not cause any error. see below entry in .classpath file, which allows to add java folder.
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
Here is my solution. It works without any issue.
There could be questions regarding why all this steps are required and i believe they are pretty genuine. But this is one of the ways to make your web application or any other component working on eclipse using Maven from command line.
1) Open a command window
2) mvn archetype:generate -DgroupId=your package -DartifactId=your Project -DarchetypeArtifactId= your archetype. In my case "maven-archetype-webapp" -DinteractiveMode=false
3) cd your Project
4) mvn eclipse:eclipse -Dwtpversion=2.0
5) Go to file system. Go to your newly created project. create folders,
a) java under main
b) test under src
c) java and resources under test
6) mvn eclipse:clean
7) mvn eclipse:eclipse -Dwtpversion=2.0
8) import your Project project in eclipse
Thanks, Sid
Right click the Maven Project -> Build Path -> Configure Build Path In Order & Export tab, you can see the message like select 'JRE System Library' and 'Maven Dependencies' checkbox Click OK Now you can them
Simply create new folder named java under src/main/
Then right click on project and select maven->update project
error occurs when the JRE System Library is wrongly pointed. Now go to Libraries tab and change the JRE System Library to the correct version.