5

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?

p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
aquila
  • 156
  • 1
  • 2
  • 12

1 Answers1

9

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.

mikołak
  • 9,605
  • 1
  • 48
  • 70
  • First, thank you for explanation about Effective POM, at least now it's clear what it is :) – aquila Aug 06 '13 at 13:56
  • I have finally found where all those repositories have been added to - .m2\settings.xml, which is kind of file with settings common to all projects, isn't it? So, is there any option to edit it conventionally or the manual approach only? – aquila Aug 06 '13 at 14:02
  • 1
    @aquila : ah, yes, I forgot to mention settings.xml, sorry about that. I've edited my answer correspondingly (and yes, you can edit them, they're just XML files, just be aware that some setting.xml can be global and used by others in the system - does not seem to be the case here). – mikołak Aug 06 '13 at 14:13