Import an existing Maven-based project to eclipse

  1. Create a new Maven Project (if you already have one, just skip this step)
$ mvn archetype:generate 
    -DgroupId=package.name.ProjectName
    -DartifactId=ProjectName 
    -Dpackage=package.name 
    -Dversion=1.0-SNAPSHOT

When asked, just keep the default configuration. It means that we’re going to use maven-archetype-quickstart archetype

  1. Convert it to Eclipse Project
$ cd ProjectName
$ mvn eclipse:eclipse
  1. Add M2_REPO to Eclipse: In Eclipse, Select Window > Preferences > Java > Build Path > Classpath Variables. Then, Click on the New… button > defined a new M2_REPO variable (if it hasn’t existed yet) and point it to your local Maven repositoryRepo
  2. Import it to Eclipse.
Advertisements
This entry was posted in Java and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s