Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Disabling artifact installation to local-repo?

I dug into the code a little bit to see if I could figure out how this works. I was hoping to be able to have a DelegatingLocalRepositoryManager which accepted two local repos and read from both but only wrote to one, but I don't think it's possible. LocalRepositoryManager seems to only handle relative paths which are then calculated relative to its LocalRepository, of which there can be only one. And the LocalRepository doesn't know the context for which it's being called, so I can't mock anything out there. I also couldn't see a way to use a custom RemoteRepository for this - perhaps there's no way to do what I want?

Cheers,
Colin

On 7 August 2015 at 18:12, Colin Fleming <colin.mailinglist@xxxxxxxxx> wrote:
Hi all,

I'm working on a Clojure IDE which uses Leiningen, a Clojure build tool, which uses Aether under the hood. The IDE resolves the Leiningen artifacts and then adds their dependencies as libraries to the project. I'm trying to develop some functionality to help users work with projects containing multiple interdependent Leiningen artifacts (each of which is an Aether artifact) without having to have them compiled and installed into their local repo.

In order to do this, I'm deploying fake artifacts from the project (empty jars) to a temporary repository on the file system. I then put the temporary repository first in the list of repositories I pass to Aether, and everything resolves correctly. The fact that the jars for the artifacts from the project are fake doesn't matter, since I trim them out and don't add libraries for them.

The one issue I can't solve is that when artifacts are resolved from the temporary repository, they're cached in the local ~/.m2 repository. Is there any way to disable this for a particular repo or for particular artifacts? Or can I set up multiple local repositories such that writes go to the first (temporary) one but reads pass through to the second (~/.m2) one?

Thanks for any advice,
Colin




Back to the top