Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Can't resolve an artifact programatically

Yann Andenmatten wrote:

       Artifact artifact = MavenPlugin.getDefault().getMaven().resolve(

             STARTER_GROUP_ID, STARTER_ARTIFACT_ID, snapshotVersion,
[...]
The MavenPlugin.getDefault().getMaven().getArtifactRepositories() call
return one remote repository:

[       id: odyssey-group.com
       url: http://maven.oams.com/content/groups/odyssey
    layout: default
snapshots: [enabled =>  false, update =>  daily]
releases: [enabled =>  true, update =>  daily]

If you are trying to resolve a snapshot artifact, you need to set
 snapshots.enabled=true
on the used remote repository. In case of a mirror, this means one of the mirrored remote repos must have the required snapshot policy, see [0] as an example that overrides "central" accordingly.



Benjamin


[0] http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html


Back to the top