[
https://jira.codehaus.org/browse/MNG-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=303579#comment-303579
]
Marco Speranza commented on MNG-2205:
-------------------------------------
Hi all...
I'm in a OSGi environment and I've the same problem.
I need to compile a project
*A* -> *B (provided)* -> *C (provided)*
B is an OSGi bunlde and A needs to use some C's packages/classes
I agree with
[Alexandre|http://jira.codehaus.org/browse/MNG-2205?focusedCommentId=141086&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-141086]
IMHO it's important to have a simple option to add a transitive 'provided'
dependency into the compile classpath.
Could be a simple solution to add a flag into the pom file (like system scope?
) that allows a provided dependency to be transitive?
i.e.
{code:xml}
<dependency>
<groupId> foo.bar </groupId>
<artifactId> project </artifactId>
<version> 1.0.0 </version>
<scope>provided</scope>
<transitive> true </transitive>
</dependency>
{code}
thanks and have a nice day :)
> "provided" scope dependencies must be transitive
> ------------------------------------------------
>
> Key: MNG-2205
> URL: https://jira.codehaus.org/browse/MNG-2205
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Dependencies
> Reporter: David Boden
> Priority: Critical
> Fix For: 3.x / Backlog
>
> Attachments: transitivetest.zip
>
>
> A provided scope dependency can also be thought of as "compile-only".
> Project A requires Sybase JConnect on the runtime classpath. Project A
> declares a "provided" dependency on Sybase JConnect.
> Project B depends upon Project A. Project B declares a "compile" dependency
> on Project A.
> Project C depends upon Project B. Project C declares a "compile" dependency
> on Project B.
> C
> | - compile dependency
> B
> | - compile dependency
> A
> | - provided dependency
> Sybase JConnect
> So, does Project C transitively depend on Sybase JConnect. Yes, of course!
> The "provided" dependency needs to be transitive.
> Ultimately, when Project C gets deployed, Sybase JConnect needs to be
> somewhere on the runtime classpath in order for the application to function.
> It's valid for Project C to assume that Sybase JConnect is available and use
> JDBC all over the Project C code. Project C is safe to do this because it can
> happily deduce that Sybase JConnect will be there in the runtime environment
> because Project A NEEDS IT.
> I've got Use Cases all over my aggregated build which make it absolutely
> critical and common sense that provided scope dependencies are transitive.
> For the (very rare) odd case where you don't want to inherit provided
> dependencies, you can <exclude/> them.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira