You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "David Boden (JIRA)" <ji...@codehaus.org> on 2006/01/18 16:11:41 UTC

[jira] Created: (MNG-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

"Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
-----------------------------------------------------------------------------------------------

         Key: MNG-1978
         URL: http://jira.codehaus.org/browse/MNG-1978
     Project: Maven 2
        Type: New Feature

  Components: Artifacts and Repositories  
    Versions: 2.0.2    
    Reporter: David Boden


Why are provided scope dependencies not transitive?

I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.

At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.

If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.



I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.

E.g. 

    <dependencies>
        <dependency>
            <groupId>SalesStation</groupId>
            <artifactId>cds_ss_shared</artifactId>
            <version>SNAPSHOT</version>
            <exclusions>
                <exclusion>
                    <groupId>SalesStation</groupId>
                    <artifactId>ss_base_shared</artifactId>
                    <!-- I want to be able to do this: -->
                    <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
                </exclusion>
            </exclusions>
        </dependency>
    </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-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

Posted by "Stephen Duncan Jr (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1978?page=comments#action_56366 ] 

Stephen Duncan Jr commented on MNG-1978:
----------------------------------------

If it can't be assumed to be provided transitively, then shouldn't it be treated as if it's compile scope for the transitive case?  

> "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
> -----------------------------------------------------------------------------------------------
>
>          Key: MNG-1978
>          URL: http://jira.codehaus.org/browse/MNG-1978
>      Project: Maven 2
>         Type: New Feature

>   Components: documentation - faqs
>     Versions: 2.0.2
>     Reporter: David Boden

>
>
> Why are provided scope dependencies not transitive?
> I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.
> At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.
> If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.
> I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.
> E.g. 
>     <dependencies>
>         <dependency>
>             <groupId>SalesStation</groupId>
>             <artifactId>cds_ss_shared</artifactId>
>             <version>SNAPSHOT</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>SalesStation</groupId>
>                     <artifactId>ss_base_shared</artifactId>
>                     <!-- I want to be able to do this: -->
>                     <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </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] Updated: (MNG-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-1978?page=all ]

John Casey updated MNG-1978:
----------------------------

    Fix Version: documentation

> "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
> -----------------------------------------------------------------------------------------------
>
>          Key: MNG-1978
>          URL: http://jira.codehaus.org/browse/MNG-1978
>      Project: Maven 2
>         Type: New Feature

>   Components: documentation - faqs
>     Versions: 2.0.2
>     Reporter: David Boden
>      Fix For: documentation

>
>
> Why are provided scope dependencies not transitive?
> I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.
> At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.
> If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.
> I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.
> E.g. 
>     <dependencies>
>         <dependency>
>             <groupId>SalesStation</groupId>
>             <artifactId>cds_ss_shared</artifactId>
>             <version>SNAPSHOT</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>SalesStation</groupId>
>                     <artifactId>ss_base_shared</artifactId>
>                     <!-- I want to be able to do this: -->
>                     <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </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-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

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

Brett Porter commented on MNG-1978:
-----------------------------------

if it is for the exclusion from the webapp, then that needs to be a feature of that plugin

> "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
> -----------------------------------------------------------------------------------------------
>
>          Key: MNG-1978
>          URL: http://jira.codehaus.org/browse/MNG-1978
>      Project: Maven 2
>         Type: New Feature

>   Components: documentation - faqs
>     Versions: 2.0.2
>     Reporter: David Boden

>
>
> Why are provided scope dependencies not transitive?
> I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.
> At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.
> If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.
> I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.
> E.g. 
>     <dependencies>
>         <dependency>
>             <groupId>SalesStation</groupId>
>             <artifactId>cds_ss_shared</artifactId>
>             <version>SNAPSHOT</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>SalesStation</groupId>
>                     <artifactId>ss_base_shared</artifactId>
>                     <!-- I want to be able to do this: -->
>                     <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </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-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

Posted by "David Boden (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1978?page=comments#action_56639 ] 

David Boden commented on MNG-1978:
----------------------------------

>it's because your dependencies don't know anything about your environment, so cannot assume it is provided.

That's a fair comment for some use cases.

However, my use case is that I've got a hierarchy of products and I have absolute control over their runtime environment. It is therefore quite appropriate and useful for me to make sweeping assumptions about the runtime environment in the base modules.


If you're distributing a web app which depends on something with "provided" dependencies then at the end of the day that dependency needs to be on the runtime classpath. You have 2 choices of how to get it there (2 use cases):
1. Package it up in your war file. This means "upgrading" the provided dependency to a compile dependency.
2. Make sure it's available to the container that's hosting the webapp.

In both these cases, the provided dependencies are much better off being transitive. You should be able to "upgrade" them to compile time dependencies. The point that I'm trying to make is that once you've declared a provided dependency in a sub-module then in all super-modules the scope of the dependency is "at least" provided. It needs to ultimately be there on the runtime classpath for any of the super-modules.

> "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
> -----------------------------------------------------------------------------------------------
>
>          Key: MNG-1978
>          URL: http://jira.codehaus.org/browse/MNG-1978
>      Project: Maven 2
>         Type: New Feature

>   Components: documentation - faqs
>     Versions: 2.0.2
>     Reporter: David Boden
>      Fix For: documentation

>
>
> Why are provided scope dependencies not transitive?
> I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.
> At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.
> If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.
> I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.
> E.g. 
>     <dependencies>
>         <dependency>
>             <groupId>SalesStation</groupId>
>             <artifactId>cds_ss_shared</artifactId>
>             <version>SNAPSHOT</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>SalesStation</groupId>
>                     <artifactId>ss_base_shared</artifactId>
>                     <!-- I want to be able to do this: -->
>                     <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </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] Updated: (MNG-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

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

Brett Porter updated MNG-1978:
------------------------------

    Component:     (was: Artifacts and Repositories)
               documentation - faqs

it's because your dependencies don't know anything about your environment, so cannot assume it is provided.

> "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
> -----------------------------------------------------------------------------------------------
>
>          Key: MNG-1978
>          URL: http://jira.codehaus.org/browse/MNG-1978
>      Project: Maven 2
>         Type: New Feature

>   Components: documentation - faqs
>     Versions: 2.0.2
>     Reporter: David Boden

>
>
> Why are provided scope dependencies not transitive?
> I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.
> At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.
> If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.
> I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.
> E.g. 
>     <dependencies>
>         <dependency>
>             <groupId>SalesStation</groupId>
>             <artifactId>cds_ss_shared</artifactId>
>             <version>SNAPSHOT</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>SalesStation</groupId>
>                     <artifactId>ss_base_shared</artifactId>
>                     <!-- I want to be able to do this: -->
>                     <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </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-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

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

Brett Porter commented on MNG-1978:
-----------------------------------

moved to docs to document the reason given in the first comment

> "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
> -----------------------------------------------------------------------------------------------
>
>          Key: MNG-1978
>          URL: http://jira.codehaus.org/browse/MNG-1978
>      Project: Maven 2
>         Type: New Feature

>   Components: documentation - faqs
>     Versions: 2.0.2
>     Reporter: David Boden
>      Fix For: documentation

>
>
> Why are provided scope dependencies not transitive?
> I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.
> At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.
> If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.
> I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.
> E.g. 
>     <dependencies>
>         <dependency>
>             <groupId>SalesStation</groupId>
>             <artifactId>cds_ss_shared</artifactId>
>             <version>SNAPSHOT</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>SalesStation</groupId>
>                     <artifactId>ss_base_shared</artifactId>
>                     <!-- I want to be able to do this: -->
>                     <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </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-1978) "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1978?page=comments#action_56563 ] 

John Casey commented on MNG-1978:
---------------------------------

why is this listed under the documentation-faqs component? isn't this a question about scope-handling, something that should be assigned to something like the core module (if that still exists)?

> "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
> -----------------------------------------------------------------------------------------------
>
>          Key: MNG-1978
>          URL: http://jira.codehaus.org/browse/MNG-1978
>      Project: Maven 2
>         Type: New Feature

>   Components: documentation - faqs
>     Versions: 2.0.2
>     Reporter: David Boden
>      Fix For: documentation

>
>
> Why are provided scope dependencies not transitive?
> I have several examples in my project where I need to declare a dependency as on the compilation classpath but not on the runtime classpath and I need it to be transitive. I don't want the dependency to be packaged up in my deployment artifact but my entire multi-project hierarchy relies on the dependency.
> At the moment, I have to workaround the problem, mostly by declaring duplicate provided scope dependencies in multiple projects.
> If there's a well-known answer to this query then apologies, could it be placed in the "Introduction to Dependency Mechanism" documentation.
> I would also be able to model my dependency structure more accurately if I could <exclude/> a dependency from the runtime classpath only and keep it in the compile classpath.
> E.g. 
>     <dependencies>
>         <dependency>
>             <groupId>SalesStation</groupId>
>             <artifactId>cds_ss_shared</artifactId>
>             <version>SNAPSHOT</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>SalesStation</groupId>
>                     <artifactId>ss_base_shared</artifactId>
>                     <!-- I want to be able to do this: -->
>                     <scope>runtime</scope> <!-- Exclude from runtime classpath only, not compile classpath -->
>                 </exclusion>
>             </exclusions>
>         </dependency>
>     </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