You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Stephen Connolly <st...@gmail.com> on 2009/04/16 19:20:26 UTC

Question about include vs includeGroupIds,includeArtifactIds

when writing a mojo that acts on dependencies.... which is the nicer
way to handle includes and excludes
dependency:purge-local-repository has a
-Dexclude=groupId:artifactId,groupId:artifactId style
while
dependency:copy-dependencies has a -DexcludeGroupIds=groupId,groupId
-DexcludeArtifactIds=artifactId,artifactId
of course if there was no existing pattern i'd probably use the
-Dexclude=g:a,g:a,g:a style only allowing wildcards
e.g. -Dexclude=g1:*,g2:a2,*:a3,g4.*:a4-*
but the fun there is shell escaping is a pain for cross-platform and
Java expects quoting to behave differently
Anyone???

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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Brian Fox <br...@infinity.nu>.
The original dependency plugin filtering syntax was intended for a 
different purpose. It was meant that you might filter only on group id 
and not a combination of all the fields.

Paul Gier wrote:
> I like the syntax that you chose using "includes" and "excludes" 
> containing a comma separated list of 
> "[groupId]:[artifactId]:[type]:[version]".  To me this is more 
> intuitive than separate fields for artifactIds, groupIds, and 
> classifiers.
>
> Although I would maybe add [classifier] also.
>
> Mark Hobson wrote:
>> 2009/4/16 Stephen Connolly <st...@gmail.com>:
>>> I've no issues with using excludes and not exclude
>>>
>>> of course the big issue I see is that all the goals in
>>> maven-dependency-plugin have different properties doing exactly the
>>> same thing!
>>>
>>> I have to say I like your syntax, as gives a way to specify a complete
>>> set with one execution.
>>>
>>> the other syntaxes are not as flexible....
>>>
>>> I guess I'm just looking for some "standard" way and a "standard name"
>>> for these "standard" ways
>>
>> The dependency:tree goal was written independently from the rest of
>> the maven-dependency-plugin and added later, hence the discrepancy.
>> I'm obviously biased as I also prefer my syntax :)  Perhaps see what
>> everyone else thinks and then we can move to a standard syntax.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Stephen Connolly <st...@gmail.com>.
2009/4/17 Brian Fox <br...@infinity.nu>:
> Each of those fields maps to a separate filter in the artifact filters. The
> filters grew over time but they were meant to be used separately most of the
> time. So you might say copy all com.sonatype or exclude org.apache but
> rarely try to specify and individual artifact...that's what the copy/unpack
> (minus the -dependencies) goals were for.
>

except they do not search the reactor... which causes problems with
the release plugin or clean builds which only go as far as package but
not as far as install

anywho the

groupId:artifactId:type:classifier:version

with trailing :'s redundant and implicit wildcards would work for that too, e.g.

org.apache is equivalent to org.apache:::: which is equivalent to
org.apache:*:*:*:*

> Paul Gier wrote:
>>
>> I like the syntax that you chose using "includes" and "excludes"
>> containing a comma separated list of
>> "[groupId]:[artifactId]:[type]:[version]".  To me this is more intuitive
>> than separate fields for artifactIds, groupIds, and classifiers.
>>
>> Although I would maybe add [classifier] also.
>>
>> Mark Hobson wrote:
>>>
>>> 2009/4/16 Stephen Connolly <st...@gmail.com>:
>>>>
>>>> I've no issues with using excludes and not exclude
>>>>
>>>> of course the big issue I see is that all the goals in
>>>> maven-dependency-plugin have different properties doing exactly the
>>>> same thing!
>>>>
>>>> I have to say I like your syntax, as gives a way to specify a complete
>>>> set with one execution.
>>>>
>>>> the other syntaxes are not as flexible....
>>>>
>>>> I guess I'm just looking for some "standard" way and a "standard name"
>>>> for these "standard" ways
>>>
>>> The dependency:tree goal was written independently from the rest of
>>> the maven-dependency-plugin and added later, hence the discrepancy.
>>> I'm obviously biased as I also prefer my syntax :)  Perhaps see what
>>> everyone else thinks and then we can move to a standard syntax.
>>>
>>> Mark
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>

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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Brian Fox <br...@infinity.nu>.
Each of those fields maps to a separate filter in the artifact filters. 
The filters grew over time but they were meant to be used separately 
most of the time. So you might say copy all com.sonatype or exclude 
org.apache but rarely try to specify and individual artifact...that's 
what the copy/unpack (minus the -dependencies) goals were for.

Paul Gier wrote:
> I like the syntax that you chose using "includes" and "excludes" 
> containing a comma separated list of 
> "[groupId]:[artifactId]:[type]:[version]".  To me this is more 
> intuitive than separate fields for artifactIds, groupIds, and 
> classifiers.
>
> Although I would maybe add [classifier] also.
>
> Mark Hobson wrote:
>> 2009/4/16 Stephen Connolly <st...@gmail.com>:
>>> I've no issues with using excludes and not exclude
>>>
>>> of course the big issue I see is that all the goals in
>>> maven-dependency-plugin have different properties doing exactly the
>>> same thing!
>>>
>>> I have to say I like your syntax, as gives a way to specify a complete
>>> set with one execution.
>>>
>>> the other syntaxes are not as flexible....
>>>
>>> I guess I'm just looking for some "standard" way and a "standard name"
>>> for these "standard" ways
>>
>> The dependency:tree goal was written independently from the rest of
>> the maven-dependency-plugin and added later, hence the discrepancy.
>> I'm obviously biased as I also prefer my syntax :)  Perhaps see what
>> everyone else thinks and then we can move to a standard syntax.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Paul Gier <pg...@redhat.com>.
You're right, classifier should come before version.  And maybe version doesn't 
need to be included in the versions plugin.
This also matches the order in the toString() method of DefaultArtifact.


Stephen Connolly wrote:
> except from our point of view (i.e. the versions maven plugin) the use
> of :version may be problematic...
> 
> I'm thinking
> 
> gID:aID:type:classifier:version
> 
> -Stephen
> 
> 2009/4/16 Paul Gier <pg...@redhat.com>:
>> I like the syntax that you chose using "includes" and "excludes" containing
>> a comma separated list of "[groupId]:[artifactId]:[type]:[version]".  To me
>> this is more intuitive than separate fields for artifactIds, groupIds, and
>> classifiers.
>>
>> Although I would maybe add [classifier] also.
>>
>> Mark Hobson wrote:
>>> 2009/4/16 Stephen Connolly <st...@gmail.com>:
>>>> I've no issues with using excludes and not exclude
>>>>
>>>> of course the big issue I see is that all the goals in
>>>> maven-dependency-plugin have different properties doing exactly the
>>>> same thing!
>>>>
>>>> I have to say I like your syntax, as gives a way to specify a complete
>>>> set with one execution.
>>>>
>>>> the other syntaxes are not as flexible....
>>>>
>>>> I guess I'm just looking for some "standard" way and a "standard name"
>>>> for these "standard" ways
>>> The dependency:tree goal was written independently from the rest of
>>> the maven-dependency-plugin and added later, hence the discrepancy.
>>> I'm obviously biased as I also prefer my syntax :)  Perhaps see what
>>> everyone else thinks and then we can move to a standard syntax.
>>>
>>> Mark
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Mark Hobson <ma...@gmail.com>.
2009/4/16 Stephen Connolly <st...@gmail.com>:
> except from our point of view (i.e. the versions maven plugin) the use
> of :version may be problematic...

How come?  Omitting version would match all versions.

> I'm thinking
>
> gID:aID:type:classifier:version

I'd be all for introducing classifier into the syntax.  You can easily
reuse the artifact filters from dependency:tree as they live in
maven-common-artifact-filters.  All the magic happens here:

http://svn.apache.org/repos/asf/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/AbstractStrictPatternArtifactFilter.java

Mark

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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Stephen Connolly <st...@gmail.com>.
except from our point of view (i.e. the versions maven plugin) the use
of :version may be problematic...

I'm thinking

gID:aID:type:classifier:version

-Stephen

2009/4/16 Paul Gier <pg...@redhat.com>:
> I like the syntax that you chose using "includes" and "excludes" containing
> a comma separated list of "[groupId]:[artifactId]:[type]:[version]".  To me
> this is more intuitive than separate fields for artifactIds, groupIds, and
> classifiers.
>
> Although I would maybe add [classifier] also.
>
> Mark Hobson wrote:
>>
>> 2009/4/16 Stephen Connolly <st...@gmail.com>:
>>>
>>> I've no issues with using excludes and not exclude
>>>
>>> of course the big issue I see is that all the goals in
>>> maven-dependency-plugin have different properties doing exactly the
>>> same thing!
>>>
>>> I have to say I like your syntax, as gives a way to specify a complete
>>> set with one execution.
>>>
>>> the other syntaxes are not as flexible....
>>>
>>> I guess I'm just looking for some "standard" way and a "standard name"
>>> for these "standard" ways
>>
>> The dependency:tree goal was written independently from the rest of
>> the maven-dependency-plugin and added later, hence the discrepancy.
>> I'm obviously biased as I also prefer my syntax :)  Perhaps see what
>> everyone else thinks and then we can move to a standard syntax.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Paul Gier <pg...@redhat.com>.
I like the syntax that you chose using "includes" and "excludes" containing a 
comma separated list of "[groupId]:[artifactId]:[type]:[version]".  To me this 
is more intuitive than separate fields for artifactIds, groupIds, and classifiers.

Although I would maybe add [classifier] also.

Mark Hobson wrote:
> 2009/4/16 Stephen Connolly <st...@gmail.com>:
>> I've no issues with using excludes and not exclude
>>
>> of course the big issue I see is that all the goals in
>> maven-dependency-plugin have different properties doing exactly the
>> same thing!
>>
>> I have to say I like your syntax, as gives a way to specify a complete
>> set with one execution.
>>
>> the other syntaxes are not as flexible....
>>
>> I guess I'm just looking for some "standard" way and a "standard name"
>> for these "standard" ways
> 
> The dependency:tree goal was written independently from the rest of
> the maven-dependency-plugin and added later, hence the discrepancy.
> I'm obviously biased as I also prefer my syntax :)  Perhaps see what
> everyone else thinks and then we can move to a standard syntax.
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 


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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Mark Hobson <ma...@gmail.com>.
2009/4/16 Stephen Connolly <st...@gmail.com>:
> I've no issues with using excludes and not exclude
>
> of course the big issue I see is that all the goals in
> maven-dependency-plugin have different properties doing exactly the
> same thing!
>
> I have to say I like your syntax, as gives a way to specify a complete
> set with one execution.
>
> the other syntaxes are not as flexible....
>
> I guess I'm just looking for some "standard" way and a "standard name"
> for these "standard" ways

The dependency:tree goal was written independently from the rest of
the maven-dependency-plugin and added later, hence the discrepancy.
I'm obviously biased as I also prefer my syntax :)  Perhaps see what
everyone else thinks and then we can move to a standard syntax.

Mark

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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Stephen Connolly <st...@gmail.com>.
I've no issues with using excludes and not exclude

of course the big issue I see is that all the goals in
maven-dependency-plugin have different properties doing exactly the
same thing!

I have to say I like your syntax, as gives a way to specify a complete
set with one execution.

the other syntaxes are not as flexible....

I guess I'm just looking for some "standard" way and a "standard name"
for these "standard" ways

-Stephen

2009/4/16 Mark Hobson <ma...@gmail.com>:
> 2009/4/16 Stephen Connolly <st...@gmail.com>:
>> when writing a mojo that acts on dependencies.... which is the nicer
>> way to handle includes and excludes
>> dependency:purge-local-repository has a
>> -Dexclude=groupId:artifactId,groupId:artifactId style
>> while
>> dependency:copy-dependencies has a -DexcludeGroupIds=groupId,groupId
>> -DexcludeArtifactIds=artifactId,artifactId
>> of course if there was no existing pattern i'd probably use the
>> -Dexclude=g:a,g:a,g:a style only allowing wildcards
>> e.g. -Dexclude=g1:*,g2:a2,*:a3,g4.*:a4-*
>> but the fun there is shell escaping is a pain for cross-platform and
>> Java expects quoting to behave differently
>> Anyone???
>
> I used the latter syntax for dependency:tree filtering, see:
>
> http://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html
>
> Although I went for 'excludes' rather than 'exclude'.  I agree that
> some consistency between plugins would be helpful.
>
> Mark
>
> ---------------------------------------------------------------------
> 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


Re: [mojo-dev] Question about include vs includeGroupIds,includeArtifactIds

Posted by Mark Hobson <ma...@gmail.com>.
2009/4/16 Stephen Connolly <st...@gmail.com>:
> when writing a mojo that acts on dependencies.... which is the nicer
> way to handle includes and excludes
> dependency:purge-local-repository has a
> -Dexclude=groupId:artifactId,groupId:artifactId style
> while
> dependency:copy-dependencies has a -DexcludeGroupIds=groupId,groupId
> -DexcludeArtifactIds=artifactId,artifactId
> of course if there was no existing pattern i'd probably use the
> -Dexclude=g:a,g:a,g:a style only allowing wildcards
> e.g. -Dexclude=g1:*,g2:a2,*:a3,g4.*:a4-*
> but the fun there is shell escaping is a pain for cross-platform and
> Java expects quoting to behave differently
> Anyone???

I used the latter syntax for dependency:tree filtering, see:

http://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html

Although I went for 'excludes' rather than 'exclude'.  I agree that
some consistency between plugins would be helpful.

Mark

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