Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Creating metadata for local installation

On Oct 19, 2011, at 337PM, Benjamin Bentmann wrote:

> Dennis Reedy wrote:
> 
>> I followed the approach you used in your example, so the DefaultServiceLocator approach is being used. I just don't know what to tell the locator to add. You've been hinting around certain things, I think we;re getting closer, I just need details.
> 
> If not already done, I strongly suggest to take a peek at the source code of the DefaultServiceLocator class (or any other class whose usage is unclear, much guess work can be eliminated by taking a glance under the hood of open source projects...).

I've already done that. Based on the documentation in the provided classes (like Installer) I had expected that the artifact(s) being installed would be accompanied by their metadata to the local repository (as clearly documented in org.sonatype.aether.impl.Installer and org.sonatype.aether.RepositorySystem.install()).

Unfortunately this is not the case, there is no metadata associated with the installed artifacts. Or at least no files found of maven-metadata*.xml

> 
>> DefaultServiceLocator locator = new DefaultServiceLocator();
>> ...
>> locator.addService( MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class );
>> 
>> Is this what I should do? What if I'm dealing with non-snapshots? What else would need to be done?
> 
> Assuming you followed my above suggestion, you either notice that the constructor of org.apache.maven.repository.internal.DefaultServiceLocator already registers the two factories or you went for the wrong class.

I went barking up the wrong tree, because the metadata installation does not happen. So I thought it was my fault (may indeed still be).

> 
> Non-snapshots get their G-A-level metadata via VersionsMetadataGeneratorFactory.
> 
> Use of the proper service locator should be all that is required in your case.

I had assumed so as well, but it just does not seem to work. My code is here [1] if you're interested.


> If not, you would have to find out what's different between your code and the examples [0, 1] from the aether-demo module that install/deploy artifacts and their metadata.

Not much difference from what I can see.

Dennis

[1] https://github.com/dreedyman/Rio/blob/rio-5.0/rio-resolver/resolver-aether/src/main/java/org/rioproject/resolver/aether/AetherService.java



Back to the top