Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 2.0.4
-
Fix Version/s: None
-
Component/s: Artifacts and Repositories
-
Labels:None
-
Environment:Linux debian 2.6.16-2-686
-
Complexity:Intermediate
Description
I wanted to try the maven-eclipse-plugin, the goal make-artifacts.
mvn eclipse:make-artifacts
However, make-artifacts goal is not in eclipse plugin 2.2, only in 2.3-SNAPSHOT.
So followed guides and added pluginRepositry section into my ~/.m2/settings.xml (attached)
so that I can use an apache plugin snapshot repository.
Then I tried:
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.3-SNAPSHOT:make-artifacts -P apache
But maven did not try to load the snapshot plugin:
...
[INFO] Failed to resolve artifact.
GroupId: org.apache.maven.plugins
ArtifactId: maven-eclipse-plugin
Version: 2.3-SNAPSHOT
Reason: Unable to download the artifact from any repository
org.apache.maven.plugins:eclipse:pom:2.3-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
We can see that maven did not try the pluginRep. specified in settings.xml.
The I found out that if I run the command above in the folder where pom.xml exists, it works.
(I created an initial project by archetype plugin.)
So it seems to me that this is a (maybe small) bug. Usually, people run maven in folder where pom.xml exists, most goals require it.
However, certain goals can run without pom.xml (such as eclipse:make-artifacts) and here it seems to me that maven ignored my settings (pluginRepositories).
Hi,
Just joigned the community then I apologize if I'm posting in the wrong place.
I just want to insist on this issue as I encountered it in several occasions.
I'm working with archetypes to give templates to the developpers. When a developper uses an archetype to initiate a new project, he hasn't got any pom.xml in his directory. Then, he's facing this bug:
We have the same issue on an existing plugin I had to adapt for our environnment (maven-archetype-plugin): I uploaded the modification on our internal repo but when another developper tries to use it, it will be downloaded from central...
Actually, we have a dirty workaround using a script including an 'artificial' pom.xml that defines the dependencies to all the problematic files. The script uses this pom (mvn compile) that does nothing (no sources) but downloads on the local developper repo the right dependencies. Then the script remove this pom and starts the real work (that is using the archetypes just downloaded).
To put it in a nutschell, any goal launched from a directory without a pom.xml will use the central repository directly, whatever is configured in the settings.xml file.
- I wrote several archetypes and deployed them in our internal repository.
- As they are in my local repository, I've got no problems to use them.
- but if another developper tries for the first time to use these archetypes, Maven, because of the bug, will try to download them not from our internal repo but directly from central and he will get an error
We have the same issue on an existing plugin I had to adapt for our environnment (maven-archetype-plugin): I uploaded the modification on our internal repo but when another developper tries to use it, it will be downloaded from central... Actually, we have a dirty workaround using a script including an 'artificial' pom.xml that defines the dependencies to all the problematic files. The script uses this pom (mvn compile) that does nothing (no sources) but downloads on the local developper repo the right dependencies. Then the script remove this pom and starts the real work (that is using the archetypes just downloaded). To put it in a nutschell, any goal launched from a directory without a pom.xml will use the central repository directly, whatever is configured in the settings.xml file.