On 10/08/2012, at 3:16 AM, "Mavroukakis, Ioannis" <imavrouka...@bgcpartners.com> wrote:
> Hello everyone, > > I'm worming my way slowly into the weird and wonderful world of maven plugin > development, and I was having a play with some of the examples in the > cookbook. > > My test artifact is version 12.8.14, the range starts at .14 and goes all the > way up to .20 and I have an Artifactory instance serving our locally produced > artifacts. I'm using the 3.0.4 plugin-api and core. > > Given the following snippet > > VersionRange versionRange = VersionRange.createFromVersionSpec("(,12.8.14]"); > > Artifact dependendArtifact = > artifactFactory.createDependencyArtifact(localArtifact.getGroupId(),localArtifact.getArtifactId(), > versionRange, localArtifact.getType(),localArtifact.getClassifier(), > localArtifact.getScope()); > List<ArtifactVersion> availableVersions = > artifactMetadataSource.retrieveAvailableVersions(dependendArtifact, > localRepo, remoteRepositories); > > I would expect that availableVersions would contain only 12.8.14. However it > returns all the deployed versions available. Going through the resolution > source I can see no obvious place where VersionRange is applied...Is my > assumption of how this is used flawed? > It's just not used for that particular method call, which looks up the metadata at the artifact level, without filtering. If you want to constrain versions, you need to use the ArtifactResolver framework. - Brett -- Brett Porter br...@apache.org http://brettporter.wordpress.com/ http://au.linkedin.com/in/brettporter http://twitter.com/brettporter --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org