Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] define multiple local repositoris

Hi,

thanks for info. No the "embeded maven repo" is some dir on harddisk, what will be for my App something like local .m2 repository.

So when my App will point to some remoteRepo, when I call resolveArtifact or other aether command, Aether will download pom/jar etc to this embeded local repository. 

But if App will point to some other local maven repository, which will have maven repository structure. I have defined some remote repository to build repository system for Aether.

But if aether will not find the Artifact in remote repository, it will troh some error i guess., therefore, i would like to try search that artifact in local .m2  repository

I think if i will fall into the "catch" block, then I will create new repositorySystem with local .m2 repo and try search that artifact again.

Thanks all for answers

Mira B



---------- Původní zpráva ----------
Od: Andreas Sewe <andreas.sewe@xxxxxxxxxxxxxx>
Komu: aether-users@xxxxxxxxxxx
Datum: 21. 4. 2015 14:06:53
Předmět: Re: [aether-users] define multiple local repositoris


Hi,

> the reason is that I am building one application, to handle its own
> local maven repository... so I would like to add some feature like, if
> the artifact is not found in the embeded application maven
> repository...to check the local m2. repository

the "embeded application maven repository" is a remote repository,
right? Then what you describe sounds like .m2/repository should, for the
purpose of your resolution request at least, also be viewed as a
*remote* repository. AFAIK, Aether automatically queries one remote
repository after the other on a request, so simply make "embeded
application maven repository" your first remote repo should result in
the fallback behavior you want.

There is one issue, however: AFAIK, the on-disk format of .m2/repository
is not exactly the same as the on-disk format of a remote repository
with file: URI; the paths to the metadata files (maven-metadata.xml) are
different. You should be able, however, to write a remote repository
implementation (with a type other than "default", say, "local") that
wraps a local repository and transparently converts between the
different conventions for path names. I am sure someone more
knowledgeable than I can tell you either how to do this or why this is a
really bad idea. ;-)

Hope this helps.

Andreas

--
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940
_______________________________________________
aether-users mailing list
aether-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aether-users

Back to the top