You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Rob ten Hove (JIRA)" <ji...@codehaus.org> on 2009/07/07 11:59:22 UTC

[jira] Commented: (MNG-1388) Transitive Dependencies in a profile are not used

    [ http://jira.codehaus.org/browse/MNG-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182802#action_182802 ] 

Rob ten Hove commented on MNG-1388:
-----------------------------------

I would not like limiting the scope of the dependency pom profile triggering to the same groupId. I'm working on a very large project with a lot of groupId's. The complete project can run on a middleware project or a stub of it. To accomplish this, the data objects that the applications use to communicate with the middleware will be either the 'real' implementations or the stubbed ones. So for each data object we have two versions: "impl" and "stub". To get the right dependencies, each project that uses the data objects will have two profiles, called "impl" and "stub". Now if I want to build an application with Maven, I will activate either profile. I just discovered that this does not work with Maven right now!

So I have this situation regarding dependencies:


{noformat}
A
  - B
  - profile id="stub"
    - DO1_stub
  - profile id="impl"
    - DO1_impl

B
  - profile id="stub"
    - DO2_stub
  - profile id="impl"
    - DO2_impl
{noformat}

If I run "mvn -Pstub clean package" on A's pom, then I will have DO1_stub but *not* DO2_stub!

I think that the profile id problem should be solved by good naming conventions, not by limiting the scope since that will reduce the applicability a lot. For example if it is a local profile, prefix it with the artifactId. If it is to be used within a group, prefix it with the groupId etc.

> Transitive Dependencies in a profile are not used
> -------------------------------------------------
>
>                 Key: MNG-1388
>                 URL: http://jira.codehaus.org/browse/MNG-1388
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 2.0
>         Environment: Windows XP using Maven 2.0.
>            Reporter: Damian Bradicich
>             Fix For: 3.x
>
>
> I have a jar project file that defines a dependency inside a certain profile.  If I then include that project inside of another war project, the dependencies defined in the jar project's profile isn't getting transferred over to the war.
> Ie we have this:
> A depends on SQL or Oracle depending on profile
> B depends on A.
> If sql profile is active, I would expect that when I build B, it pulls
> the transitive dependancy on sql from A.  

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