Home > Dev Stuffs, Java, maven > Add M2_REPO to eclipse

Add M2_REPO to eclipse


Maven

While working with maven projects we normally need to create the M2_REPO variable on Eclipse.

Normally I was used to do manually with these steps:

 - Eclipse > Window > Preferences > Select the Java > Build Path > Classpath
 - Point to your maven repository, shall me under: ~/.m2/repository
 - >rebuild your project

But a easiest way is:

>mvn eclipse:add-maven-repo -Declipse.workspace={PATH_TO_YOUR_WORKSPACE}

If you are thinking on “Where do I need to point my M2_REPO”
Answer: You need to point to your {home}/.m2/repository

  1. 2012.December.27 at 18:27

    Excellent post. I was checking constantly this blog and I’m impressed! Extremely helpful info specially the last partūüôā I care for such information a lot. I was seeking this particular info for a very long time. Thank you and best of luck.

  1. No trackbacks yet.

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

%d bloggers like this: