Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get Eclipse work with Maven and SVN correctly?

I have a multi-modules Maven project checked out from SVN. I installed m2eclipse in Eclipse. Then I imported the project into Eclipse. Everything is fine. But after I update my Maven project from SVN(outside of Eclipse), Eclipse will give me a lot of errors and warnings unless I import the project again. That is really annoying. I have to import the project every time that I update it from SVN.

Is there a solution?

Thanks a lot. :)

like image 581
Smartmarkey Avatar asked Feb 28 '11 08:02

Smartmarkey


People also ask

Does Eclipse work with Maven?

The Eclipse IDE provides support for the Maven build. This support is developed in the M2Eclipse project. It provides an editor for modifying the pom file and downloads dependencies if required. It also manages the classpath of the projects in the IDE.

Which Eclipse IDE is best for Maven project?

Eclipse is one of the most popular IDEs for Java and Android application development. It provides an excellent plugin, M2Eclipse, which integrates Maven and Eclipse. M2Eclipse automatically downloads required dependencies from remote Maven repositories.

How do I use Maven in Eclipse?

#1) From the top menu of Eclipse select Help -> Install new Software, and the following window will open. #2) Click on the Add button highlighted in the above image. An add repository dialogue box will open, enter the following in the two text fields of this box. Click on the Add button.


2 Answers

Install Subclipse see here: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

Then install, m2eclipse and m2eclipse extras as mentioned here: http://m2eclipse.sonatype.org/installing-m2eclipse.html

After, these are done.

  1. Open Eclipse go to Window > Open Perspective > Other... > SVN Repository Exploring
  2. Add URL to SVN repository/code base.
  3. Select a project. Right Click and select Checkout as Maven Project. You're done.

Now, update, commit, delete, build all from inside Eclipse.

like image 130
Nishant Avatar answered Sep 30 '22 07:09

Nishant


Install m2e and subclipse from the Eclipse Marketplace depending on what version of Eclipse you have. Then:

  1. Open Eclipse go to Window > Open Perspective > Other... > SVN Repository Exploring.
  2. Add your svn url to SVN repository/code base.
  3. Select a project. Right Click and select Checkout.
  4. Assuming your project has a pom.xml, switch back to your Java perspective, select the project that was just imported, right click and select Configure > Convert to Maven Project.
like image 37
yellavon Avatar answered Sep 30 '22 09:09

yellavon