In previous article, we have covered how to set M2_REPO classpath variable for maven dependencies resolution in Eclipse IDE
Sometimes by default M2_REPO classpath variable comes added with Eclipse IDE, especially in the newer versions like Kepler, Luna or Mars OR if you install maven plugins to older versions of Eclipse IDE like Juno or Indigo
Although, its seems to be good news with pre-built Maven integration with Eclipse IDE but the annoying thing is –> this is doesn’t point to correct maven local repository location and in addition to this, classpath variable M2_REPO is non-modifiable
Q) Are there are any solutions to rectify it?
- Very well, we can modify this classpath variable but not directly –> there is way to go
- Let’s see what is the solution to correct it
1. Solution for M2_REPO is Non Modifiable :
Step 1: Open Eclipse IDE –> Windows –> Preferences
Step 2: Maven –> Users Settings
User Settings (open file)
Browse through the correct “settings.xml” file –> Click “Update Settings”
Local Repository (from merged user and global settings)
This is will update the “Local Repository” location –> picking the value of <localRepository> tag from the settings.xml
That’s all ….. automatically everything will get updated
2. Useful Eclipse IDE shortcuts :
- Eclipse IDE – How to show line numbers ?
- Eclipse IDE – How to GO TO any line number directly ?
- Eclipse IDE – How to remove unused imports ?
- Eclipse IDE – How to clean project ?
- Eclipse IDE – How to build Java project automatically ?
- Eclipse IDE – How to comment and un-comment line & block ?
- Eclipse IDE – How to generate constructor using fields ?
- Eclipse IDE – How to generate getters and setters ?
- Eclipse IDE – How to search files ?
- Eclipse IDE – How to locate methods in Java file ?
- Eclipse IDE – How to open editor using CTRL + E ?
- Eclipse IDE – Java compiler compliance level issue
Related Articles:
- Eclipse + Maven – Integration
- Eclipse + Maven – How to import Maven project with pom.xml ?
- Eclipse + Maven – Setting M2_REPO classpath variable in IDE
- Eclipse + Maven – M2_REPO is Non Modifiable
- Eclipse + Maven – Creating and exploring projects using archetypes
- Eclipse + Maven – Converting Web project to Maven project
- Eclipse + Maven – mvn eclipse:eclipse command
- Eclipse + Maven – Plugin execution not covered by lifecycle configuration
- Apache Maven – Introduction
- Apache Maven – Install on Windows 7 OS
- Apache Maven – Settings.xml explanation
- Apache Maven – Proxy setting explanation
- Apache Maven – pom.xml explanation
- Apache Maven – Plugins explanation
- Apache Maven – Changing default Maven repository location in Windows 7 OS
- Apache Maven – Local, Central and Remote Repositories
- Apache Maven – Installing custom library into local repository
- Apache Maven – Transitive dependencies explanation
- Apache Maven – Exclusion of Transitive dependencies
- Apache Maven – Dependency Scopes
- Apache Maven – Skipping unit test using surefire plugin
- Apache Maven – Exclusions and Inclusions of unit test
- Apache Maven – offline execution
- Apache Maven – Co-ordinates explained
Happy Coding !!
Happy Learning !!