Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove repositories from Effective POM

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?

like image 525
aquila Avatar asked Aug 06 '13 11:08

aquila


People also ask

How to display effective pom in Maven?

Now open command console, go the folder containing pom.xml and execute the following mvn command. Maven will start processing and display the effective-pom. [INFO] Scanning for projects...

Why is my effective pom view read-only?

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.

What is the effective pom in IntelliJ IDEA?

This area contains Maven repositories that are configured in the Effective POM file which lists the default configurations, profiles and goals. IntelliJ IDEA updates the list of repositories automatically.

How do I specify the use of multiple repositories?

There are two different ways that you can specify the use of multiple repositories. The first way is to specify in a POM which repositories you want to use. That is supported both inside and outside of build profiles:


1 Answers

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.

like image 80
mikołak Avatar answered Nov 15 '22 07:11

mikołak