Hi, i have been facing a problem when resolving snaphot version of
plugin thru a mirror. It works well when there is no mirror.
I have configured in my setting.xml repositories pointing out our
Artifactory server and also a mirror pointing out to the same server to
capture any request.
In my case, i downloaded the latest version of maven-archetype-plugin
(2.1-SNAPSHOT) from the svn's trunk. Then i deployed it in our
artifactory server and ,finally, i deleted my whole local repo. Next,
when running "mvn archetype:generate", Maven tries to resolve latest
version of the plugin , in this case snapshot, throwing the following error:
/Reason: Error getting POM for
'org.apache.maven.plugins:maven-archetype-plugin' from the repository:
Failed to resolve artifact, possibly due to a repository list that is
not appropriately equipped for this artifact's metadata.
org.apache.maven.plugins:maven-archetype-plugin:pom:2.1-SNAPSHOT
/
Both plugin's and snapshot's maven-metadata are ok:
*org/apache/maven/plugins/maven-archetype-plugin/maven-metadata.xml*
<metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
<versioning>
<latest>2.1-SNAPSHOT</latest>
<release>2.0</release>
<versions>
<version>1.0-alpha-3</version>
<version>1.0-alpha-4</version>
<version>1.0-alpha-7</version>
<version>2.0-alpha-1</version>
<version>2.0-alpha-2</version>
<version>2.0-alpha-3</version>
<version>2.0-alpha-4</version>
<version>2.0-alpha-5</version>
<version>2.0</version>
<version>2.1-SNAPSHOT</version>
</versions>
<lastUpdated>20110420113107</lastUpdated>
</versioning>
</metadata>
*org/apache/maven/plugins/maven-archetype-plugin/2.1-SNAPSHOT/maven-metadata.xml*
<metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20110420.112731</timestamp>
<buildNumber>1</buildNumber>
</snapshot>
<lastUpdated>20110420111844</lastUpdated>
</versioning>
</metadata>
After debuging Maven I noticed that even having the mirror defined,
SNAPSTHOP version of plugins always were resolved agains Maven`s central
repository (repo1.apache.org). So we found a workaround overriding
central and snapshot repositories in the setting xml. After that, it worked.