Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Using Aether for classpath management

On 13.10.2011 11:13, Alexander Pokahr wrote:
> 1. I want to make use of the existing maven infrastructure (e.g. 
> settings.xml and information from the POMs). Is there a clean way
> to obtain such settings in the way maven does it? The Aether demo
> only uses hard-coded information (e.g. local and remote repository
> locations)...

You can use maven-settings and set up your RepositorySystemSession
accordingly. There is code in the aether-ant-tasks doing just that, so
you could take a look there[1]. There is also some code in the
sisu-maven-bridge project on github that might be helpful[2].

> 3. Is there a way that I can tweak Aether to work on artifacts in
> a workspace instead of a local or remote repository?

You need to set up a WorkspaceReader. This reader will be asked before
local or remote resolution is attempted. The aether-ant-tasks for
example do that for locally built artifacts[3].

Ben

[1]
https://github.com/sonatype/aether-ant-tasks/blob/master/src/main/java/org/sonatype/aether/ant/AntRepoSys.java#L301
[2]
https://github.com/sonatype/sisu-maven-bridge/blob/develop/src/main/java/org/sonatype/sisu/maven/bridge/internal/DefaultMavenSettings.java
[3]
https://github.com/sonatype/aether-ant-tasks/blob/master/src/main/java/org/sonatype/aether/ant/ProjectWorkspaceReader.java


Back to the top