You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Romain Gilles <ro...@gmail.com> on 2013/10/30 14:24:10 UTC

Get last version of a artifact

Hi all,
I'm developing a maven plugin and I want to discover the last version of a
specific artifact. I had a look to the maven-vesions-plugin. But I don't
know why when I try to get a (deprecated) ArtifacteMetadataSource as follow:
   @Component
    private ArtifactMetadataSource artifactMetadataSource

I get an exception:

1) No implementation for
org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource was
bound.

I'm usign Maven 3.0.5 as a model and runtime.
Could somebody help me?

Thanks,

Romain.

Re: Get last version of a artifact

Posted by Jeff MAURY <je...@jeffmaury.com>.
You're probably missing a dependency.

Jeff


On Wed, Oct 30, 2013 at 2:24 PM, Romain Gilles <ro...@gmail.com>wrote:

> Hi all,
> I'm developing a maven plugin and I want to discover the last version of a
> specific artifact. I had a look to the maven-vesions-plugin. But I don't
> know why when I try to get a (deprecated) ArtifacteMetadataSource as
> follow:
>    @Component
>     private ArtifactMetadataSource artifactMetadataSource
>
> I get an exception:
>
> 1) No implementation for
> org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource was
> bound.
>
> I'm usign Maven 3.0.5 as a model and runtime.
> Could somebody help me?
>
> Thanks,
>
> Romain.
>



-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Re: Get last version of a artifact

Posted by Romain Gilles <ro...@gmail.com>.
Ok so I test it and it works now. Thank you! I'm so stupid I didn't check
that I was importing the legacy one and not the maven api one!!!
By the way, in maven 3 it seems that this interface is deprecated. How do
you plan to provide this kind of service in the future?

Many thanks,

Romain.


2013/10/30 Stuart McCulloch <mc...@gmail.com>

> Looking at the *MetadataSource components in the Maven source they're only
> bound under:
>
>         org.apache.maven.artifact.metadata.ArtifactMetadataSource
>
> and not:
>
>         org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource
>
> For example in MavenMetadataSource.java:
>
>         import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
>         // ...
>
>         @Component( role = ArtifactMetadataSource.class, hint = "maven" )
>         public class MavenMetadataSource
>             implements ArtifactMetadataSource
>         {
>             // ...
>
> So if you change to use
> org.apache.maven.artifact.metadata.ArtifactMetadataSource it should work
> (this is the API supported by both Maven 2.x and 3.x)
>
> HTH
>
> On 30 Oct 2013, at 13:24, Romain Gilles wrote:
>
> > Hi all,
> > I'm developing a maven plugin and I want to discover the last version of
> a
> > specific artifact. I had a look to the maven-vesions-plugin. But I don't
> > know why when I try to get a (deprecated) ArtifacteMetadataSource as
> follow:
> >   @Component
> >    private ArtifactMetadataSource artifactMetadataSource
> >
> > I get an exception:
> >
> > 1) No implementation for
> > org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource was
> > bound.
> >
> > I'm usign Maven 3.0.5 as a model and runtime.
> > Could somebody help me?
> >
> > Thanks,
> >
> > Romain.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Get last version of a artifact

Posted by Stuart McCulloch <mc...@gmail.com>.
Looking at the *MetadataSource components in the Maven source they're only bound under:

	org.apache.maven.artifact.metadata.ArtifactMetadataSource

and not:

	org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource

For example in MavenMetadataSource.java:

	import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
	// ...

	@Component( role = ArtifactMetadataSource.class, hint = "maven" )
	public class MavenMetadataSource
	    implements ArtifactMetadataSource
	{
	    // ...

So if you change to use org.apache.maven.artifact.metadata.ArtifactMetadataSource it should work (this is the API supported by both Maven 2.x and 3.x)

HTH

On 30 Oct 2013, at 13:24, Romain Gilles wrote:

> Hi all,
> I'm developing a maven plugin and I want to discover the last version of a
> specific artifact. I had a look to the maven-vesions-plugin. But I don't
> know why when I try to get a (deprecated) ArtifacteMetadataSource as follow:
>   @Component
>    private ArtifactMetadataSource artifactMetadataSource
> 
> I get an exception:
> 
> 1) No implementation for
> org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource was
> bound.
> 
> I'm usign Maven 3.0.5 as a model and runtime.
> Could somebody help me?
> 
> Thanks,
> 
> Romain.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org