You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Brett Porter (JIRA)" <ji...@codehaus.org> on 2005/05/19 05:13:34 UTC

[jira] Created: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

allow exclusion of certain dependencies from inclusion in an archive
--------------------------------------------------------------------

         Key: MNG-415
         URL: http://jira.codehaus.org/browse/MNG-415
     Project: m2
        Type: Improvement
  Components: maven-plugins, maven-archiver  
    Versions: 2.0-alpha-2    
    Reporter: Brett Porter
     Fix For: 2.0-alpha-3


this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Commented: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-415?page=comments#action_39286 ]
     
Brett Porter commented on MNG-415:
----------------------------------

(in future - please don't use jira for design discussions - that's what the dev list is for).

to your point, however - making your change:
a) triples what needs to be specified for most compile dependencies - you'd also need to specify test, and hope we never add anything else implied from compile. This violates the rule we're following of making the defaults work most of the time, and the amount of configuration needed minimal.
b) is not actually scope any more. Excluding something from runtime, but including it compile assumes something about the end environment, which the dependencies should not do - that's the job of the assembling plugin. From a pure point of view a compile time dependency is always needed at runtime (unless the code is never hit, or the server provides the jar, all of which is environmental, not by definition)

So unless there is something else missing, the scope will remain as it is. We can't go breaking backwards compatibility unless it is a really serious problem that we can't take forward.

If you feel the description of scope in the doc above is unclear, please propose alternate wording or point out the sections that don't make sense... thanks.


> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: m2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Commented: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Hugo Palma (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-415?page=comments#action_39287 ]
     
Hugo Palma commented on MNG-415:
--------------------------------

I find the names "compile" and "runtime" dependencies misleading. If i didn't read the documentation my guess would be that "compile" dependencies are used for compiling only and are never included in a package and that "runtime" dependencies would be used for compiling and would be packaged. I find the choice that was made very confusing.

Is there any reason why it's not donne the way i've described ? If it was it would solve this particular BUG and i think it would make it's use much more obvious. 

> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: m2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Commented: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-415?page=comments#action_39288 ]
     
Brett Porter commented on MNG-415:
----------------------------------

Hugo - if you make "runtime" imply "compile" you can never have a runtime only dependency, which is a valid and common use case (ie anything where you only call into it via reflection - like a JCE provider, etc).

I'm happy to hear ways to make it less confusing, but the behaviour is absolutely correct.

This is not a BUG, and this issue really has little to do with scope. It is about the archive plugins not being configurable enough about what they bundle.

I'll keep replying here if there are comments for the sake of keeping it together, but I'd really appreciate taking it to the dev list.

> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: m2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Commented: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Michal Maczka (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-415?page=comments#action_39283 ]
     
Michal Maczka commented on MNG-415:
-----------------------------------

EAR is a different case then WAR as not only you must decide what will be included in the archive 
but also attach some information to some dependencies (e.g. context roots for wars)

The decison of what gets included and what not can be based on artifact's type and scope.
For wars in particular only all runtime dependecies should be included and nothing else (compile and test dependecies should be skipped). So one of the possible solutons would be to enable to enumerate dependency scopes rather then assume that all compile time dependecies are also runtime dependecies.

To give an example

<dependency>
  
   <scope>runtime</scope>  (will be included in the war)
</dependency>


<dependency>
  
   <scope>runtime</scope>  (will be included in the war)
   <scope>compile</scope>  
</dependency>


<dependency>
  
 
   <scope>compile</scope>  (will not be included in the war)
</dependency>


<dependency>
   
   <scope>test</scope>  (will not be included in the war)
</dependency>

This approch seems to be the most natural and simple one and covers in a generic way all the cases I can think of. 

Note the artifact scope given at the top level affects also dependencies of dependencies.





> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: m2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Commented: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-415?page=comments#action_39284 ]
     
Brett Porter commented on MNG-415:
----------------------------------

Michal, you've misunderstood how scopes work - please read http://maven.apache.org/maven2/dependencies.html. Only test is excluded from the war, and this is how it already works. Additional measures are needed, because servletapi is a valid compile/runtime jar but should not be bundled because the container always provides it.

The EAR stuff such as context roots was already being discussed in the linked issue, MNG-148.

> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: m2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Closed: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-415?page=all ]
     
Brett Porter closed MNG-415:
----------------------------

    Resolution: Fixed

> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>     Assignee: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Commented: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-415?page=comments#action_41386 ] 

Brett Porter commented on MNG-415:
----------------------------------

we resolved this here:
http://docs.codehaus.org/pages/viewpage.action?pageId=26408

Provided Scope

Add a provided scope that makes a dependency essentially compile scope, but it is not bundled, not on the execution classpath (eg for surefire) and the dependency is not transitive. It is intended for use in the final "end POM" only.

This addresses "compile only" dependencies, while not losing the benefits of having the scopes tied to each other.


> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>     Assignee: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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


[jira] Commented: (MNG-415) allow exclusion of certain dependencies from inclusion in an archive

Posted by "Michal Maczka (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-415?page=comments#action_39285 ]
     
Michal Maczka commented on MNG-415:
-----------------------------------

I understood how the scopes work and that why I am proposing is to change it as this seems to be the simplest
solution for this problem.

Really what you want to bundle in wars, ears and such  artifacts are only runtime dependecies.
servletapi is compile time only dependency but __it is not__ a runtime dependecy so it should not be bundled in wars. 

This seems to be natural for me and apparently for some other people.
Look at the subject of the thread:

"how to exclude compile time only jars from .war?"




> allow exclusion of certain dependencies from inclusion in an archive
> --------------------------------------------------------------------
>
>          Key: MNG-415
>          URL: http://jira.codehaus.org/browse/MNG-415
>      Project: m2
>         Type: Improvement
>   Components: maven-plugins, maven-archiver
>     Versions: 2.0-alpha-2
>     Reporter: Brett Porter
>      Fix For: 2.0-alpha-3

>
>
> this has been requested for WAR, but it should apply to all archives that include dependencies.

-- 
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


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