You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gwyn Evans (JIRA)" <ji...@codehaus.org> on 2006/04/21 21:33:19 UTC

[jira] Created: (MDEP-21) Option to not copy 'provided' scoped jars

Option to not copy 'provided' scoped jars
-----------------------------------------

         Key: MDEP-21
         URL: http://jira.codehaus.org/browse/MDEP-21
     Project: Maven 2.x Dependency Plugin
        Type: Wish

 Environment: Maven2
    Reporter: Gwyn Evans


It would be useful if there were an option that could be set such that a 'scope=provided' jar would not be copied via copy-dependencies, but I can't see any way of setting such or otherwise excluding such a jar from the copy.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MDEP-21) Option to not copy 'provided' scoped jars

Posted by "Brian Fox (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MDEP-21?page=all ]

Brian Fox closed MDEP-21.
-------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-ALPHA1

Added the ability to specify a scope to exclude. This uses the plexus ScopeArtifactFilter, which defines what scopes are included. For example, since test scope effectively includes all other scopes, then excluding the test scope would exclude everything. (which the plugin won't allow)

> Option to not copy 'provided' scoped jars
> -----------------------------------------
>
>                 Key: MDEP-21
>                 URL: http://jira.codehaus.org/browse/MDEP-21
>             Project: Maven 2.x Dependency Plugin
>          Issue Type: Wish
>         Environment: Maven2
>            Reporter: Gwyn Evans
>         Assigned To: Brian Fox
>             Fix For: 2.0-ALPHA1
>
>
> It would be useful if there were an option that could be set such that a 'scope=provided' jar would not be copied via copy-dependencies, but I can't see any way of setting such or otherwise excluding such a jar from the copy.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MDEP-21) Option to not copy 'provided' scoped jars

Posted by "mark struberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MDEP-21?page=all ]

mark struberg updated MDEP-21:
------------------------------

    Attachment: MDEP-21.patch

test case fixes

> Option to not copy 'provided' scoped jars
> -----------------------------------------
>
>                 Key: MDEP-21
>                 URL: http://jira.codehaus.org/browse/MDEP-21
>             Project: Maven 2.x Dependency Plugin
>          Issue Type: Wish
>         Environment: Maven2
>            Reporter: Gwyn Evans
>         Assigned To: Brian Fox
>             Fix For: 2.0-alpha-1
>
>         Attachments: MDEP-21.patch
>
>
> It would be useful if there were an option that could be set such that a 'scope=provided' jar would not be copied via copy-dependencies, but I can't see any way of setting such or otherwise excluding such a jar from the copy.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MDEP-21) Option to not copy 'provided' scoped jars

Posted by "Gwyn Evans (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MDEP-21?page=comments#action_64767 ] 

Gwyn Evans commented on MDEP-21:
--------------------------------

It looks as if the line 
    DefaultArtifact artifact = (DefaultArtifact) i.next();
should be
    Artifact artifact = (Artifact) i.next();
by the way...

> Option to not copy 'provided' scoped jars
> -----------------------------------------
>
>          Key: MDEP-21
>          URL: http://jira.codehaus.org/browse/MDEP-21
>      Project: Maven 2.x Dependency Plugin
>         Type: Wish

>  Environment: Maven2
>     Reporter: Gwyn Evans

>
>
> It would be useful if there were an option that could be set such that a 'scope=provided' jar would not be copied via copy-dependencies, but I can't see any way of setting such or otherwise excluding such a jar from the copy.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MDEP-21) Option to not copy 'provided' scoped jars

Posted by "Gwyn Evans (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MDEP-21?page=comments#action_64061 ] 

Gwyn Evans commented on MDEP-21:
--------------------------------

Just in case you think this is worth doing....

Index: CopyDependenciesMojo.java
===================================================================
--- CopyDependenciesMojo.java	(revision 1841)
+++ CopyDependenciesMojo.java	(working copy)
@@ -60,7 +60,12 @@
 
         for ( Iterator i = artifacts.iterator(); i.hasNext(); )
         {
-            copyArtifact( (DefaultArtifact) i.next(), this.stripVersion );
+            DefaultArtifact artifact = (DefaultArtifact) i.next();
+            String aScope = artifact.getScope();
+            // Gwyn: Only copy if not provided & not system
+            if (!Artifact.SCOPE_PROVIDED.equals( aScope ) && !Artifact.SCOPE_SYSTEM.equals( aScope )) {
+                copyArtifact( artifact, this.stripVersion );
+            }
         }
     }
 


> Option to not copy 'provided' scoped jars
> -----------------------------------------
>
>          Key: MDEP-21
>          URL: http://jira.codehaus.org/browse/MDEP-21
>      Project: Maven 2.x Dependency Plugin
>         Type: Wish

>  Environment: Maven2
>     Reporter: Gwyn Evans

>
>
> It would be useful if there were an option that could be set such that a 'scope=provided' jar would not be copied via copy-dependencies, but I can't see any way of setting such or otherwise excluding such a jar from the copy.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira