maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: How to filter Project artifacts/dependencies?
Date Thu, 17 Oct 2013 08:04:50 GMT
You can use requiresDependencyResolution (as Anders mentioned below) to choose the initial
scope of what gets populated into project.getArtifacts

You can also use maven-common-artifact-filters to filter those artifacts further by scope,
groupId, artifactId, etc:

	http://maven.apache.org/shared/maven-common-artifact-filters/project-summary.html
	http://maven.apache.org/shared/maven-common-artifact-filters/apidocs/index.html

On 17 Oct 2013, at 07:26, Anders Hammar wrote:

> I believe you handle scope via the Mojo annotation [1]. Have a look at*
> requiresDependencyResolution.*
> 
> [1]
> http://maven.apache.org/plugin-tools/maven-plugin-annotations/apidocs/org/apache/maven/plugins/annotations/Mojo.html
> 
> /Anders
> 
> 
> On Thu, Oct 17, 2013 at 5:00 AM, Pino Silvaggio <pino.silvaggio@gmail.com>wrote:
> 
>> I am writing a Maven plugin which needs to filter a project dependencies
>> based criteria like scope, is snapshot, is optional, the groupId, etc...
>> 
>> So, all the Project.getRuntimeArtifacts(), getCompileArtifacts(), etc..
>> are deprecated.
>> 
>> There is still getArtifacts().
>> 
>> But how do you filter a project dependencies efficiently. Yea, I've looked
>> at aether but that doesn't seem to be an option since it doesn't look like
>> there is a way to account for the project resolved dependencies?
>> 
>> So the question is how do you filter a project dependencies like aether
>> can with filters.
>> 
>> Also, why is there no way to ask if a dependency will be in a specific
>> scope?
>> 
>> Like if dependency a will be in scope Runtime, Compile and Test.
>> 
>> -
>> 
>> p
>> 
>> 
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@maven.**apache.org<users-unsubscribe@maven.apache.org>
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 


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


Mime
View raw message