We know that what is use maven and how to use it from command prompt. Maven dependencies can be read from eclipse IDE also which maven exposes through M2_REPO classpath variable which points to maven’s local repository. This class variable must be added to eclipse ‘s class path variable on build path before using maven’s dependencies. Lets see how to do this:
Step 1) Go to menu Windows > Preferences
Step 2) Navigate to Java > Build path > Classpath Variables
Step 3) Define new classpath variable M2_REPO and point it to local maven repository
Step 4) Verify that variable has been added
Happy Learning !!






changed facet correctly, but to create web application from scratch mvn archetype:generate
is stopping at number 242 :242 which creates, not a simple quick start web project but plugin project.
which does not takes dependencies in pom file .
so why mvn behavior is correct ?as it has so many options up till 710 , so what do ?
Posted by Rajendra Joshi | 8 January, 2013, 2:38 amYou must be having another maven version. Mine is 3.0.4. So, this list can differ.
Filter for archetype quickstart like in below post.
http://howtodoinjava.com/2013/01/02/create-a-simple-java-project-using-maven/
Posted by Lokesh Gupta | 8 January, 2013, 2:59 amI don’t have Modify Project option in projects facets page
what to do?
Posted by Rajendra Joshi | 7 January, 2013, 6:30 amFollow: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jst.j2ee.doc.user%2Ftopics%2Ftchangejavalevel.html
Posted by Lokesh Gupta | 7 January, 2013, 8:19 amyes I have added the repository but demoWebApplication gives folloing error
when I changed java compiler from 1.7 to 1.6 ,even for java 1.7 this error was there
Description Resource Path Location Type
Java compiler level does not match the version of the installed Java project facet. demoWebApplication Unknown Faceted Project Problem (Java Version Mismatch)
and when I create myfirstServlet and try to run it ,it gives
HTTP 404 error-requested re source not available
Pl give the remedy
Posted by Rajendra Joshi | 7 January, 2013, 4:59 amRefer to following link for changing project facets correctly. Correct the JRE version here installed in your system.
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jst.j2ee.doc.user%2Ftopics%2Ftchangejavalevel.html
Posted by Lokesh Gupta | 7 January, 2013, 5:07 am