Reputation: 156
I have hard times learning Maven those days, it seems more difficult than learning all 4-5 programming languages I know altogether. However first steps are made and I succeeded to build a first Java REST services project based on Jersey in Eclipse with m2eclipse plugin. As I tried to do that I added a bunch of global repositories most of which are either irrelevant or incorrect and somehow I added all of them to 'Effective POM' instead of project POM so there are number of garbage repositories globally. Now the question:
How can I edit/manage 'Effective POM' in order to remove those repositories? I tried to do that with built in POM editor but it shows it as read-only, also tried to remove them through 'Maven Repositories' tab but there is no such option at all.
Maybe there is some way to edit it manually, where does global POM resides in file system?
In 'Effective POM' I can see added repositories duplicated in both tags <repository>
and <pluginRepository>
. What is the difference between those tags? If I remove them manually, should I remove both?
Upvotes: 5
Views: 16980
Reputation: 9705
The "Effective POM" is what Maven constructs when it parses your project. It's composed of your POM and its (grand)parent POMs. The Effective POM does not exist on your filesystem per se, it's generated on-the-fly whenever your run a Maven build - hence why the view is "read-only".
In other words - you haven't added those repositories to your Effective POM, but to one of your project's ancestor POMs, or one of the settings.xml files resolved by mvn and/or Eclipse. Remove those entries from there and your problem will be solved.
Upvotes: 9