maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dillon <ja...@planet57.com>
Subject Re: How to get ${localRepository} from plexus component (not mojo)
Date Tue, 10 Oct 2006 21:17:06 GMT
Is the MavenSession bound to a component?  Or can I pluck it some  
other way from the plexus container?

--jason


On Oct 9, 2006, at 6:25 AM, Jason van Zyl wrote:

> What is it that you're actually trying to do?
>
> Jason.
>
> On 9 Oct 06, at 3:03 AM 9 Oct 06, Jason Dillon wrote:
>
>> No I did not send that message 5 times.
>>
>> I need the localRepository for calls like:
>>
>> <snip>
>> artifactCollector.collect(
>>                 project.getDependencyArtifacts(),
>>                 project.getArtifact(),
>>                 managedVersions,
>>                 getArtifactRepository(), // ${localRepository}
>>                 project.getRemoteArtifactRepositories(),
>>                 artifactMetadataSource,
>>                 null,
>>                 Collections.singletonList(listener));
>> </snip>
>>
>> or:
>>
>> <snip>
>> getArtifactResolver().resolve(artifact, getProject 
>> ().getRemoteArtifactRepositories(), getArtifactRepository());
>> </snip>
>>
>> --jason
>>
>>
>> On Oct 9, 2006, at 12:38 AM, Kenney Westerhof wrote:
>>
>>>
>>> Is it my mail client or did you really send this message 5 times?
>>>
>>> The settings object (which contains the local repo) is not a  
>>> component,
>>> so you can't inject that.
>>> You could re-parse the settings.xml yourself, but that's not a nice
>>> solution.
>>>
>>> I think you're stuck with passing the settings or local repo to  
>>> the component
>>> on method calls, or call a setter.
>>>
>>> Btw, why do you need the local repository? If it's for artifact  
>>> resolution you could also a component from maven-artifact(-manager).
>>>
>>> -- Kenney
>>>
>>> Jason Dillon wrote:
>>>> Anyone know how to get the "${localRepository}"  
>>>> ArtifactRepository from a Plexus component... not a mojo.
>>>> More specifically I have created a new component, which I inject  
>>>> into my mojo (with @component and a <component> role defined in  
>>>> plexus/components.xml) and I want that injected component to  
>>>> have access to "${localRepository}", but I don't want to define  
>>>> that in my mojo and pass it in to the component each time it  
>>>> needs it.
>>>> Anyone know how to do this?
>>>> Thanks,
>>>> --jason
>>>> ------------------------------------------------------------------- 
>>>> --
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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


Mime
View raw message