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

Jörg Schaible commented on MNG-1388:
------------------------------------

bq. selecting both win32-x86 and linux-gcc (from Wiebkes post)

Where was there a requirement that both platform profiles have to be active *at 
the same time* ?

Let's make an example:

parent.xml:
{code:xml|Title=parent.xml}
 ...
 <dependencyManagement>
  <dependencies>
   <dependency>
    <groupId>com.company.project</groupId>
    <artifactId>component</artifactId>
    <version>1.0</version>
    <classifier>${company.platform}</classifier>
   </dependency>
   ...
  </dependencies>
 </dependencyManagement>
 ...
 <profiles>
  <profile>
   <activation>
    <property>linux</property>
   </activation>
   <properties>
    <company.platform>linux-gcc</company.platform>
   </properties>
  </profile>
  ..
 </profiles>
 <properties>
  <company.platform>win32-x86</company.platform><!-- default -->
  ...
 </properties>
{code}

parent.xml:
{code:xml|Title=parent.xml}
 ...
 <dependencies>
  <dependency>
   <groupId>com.company.project</groupId>
   <artifactId>component</artifactId>
   <classifier>${company.platform}</classifier>
  </dependency>
  ...
 </dependencies>
 <properties>
  <!-- you can overwrite directly if no other platform is required for this 
project
  <company.platform>win32-x86</company.platform>
  -->
 </properties>
{code}

In this example I've used the property "linux" as activator, but you might use 
activation based on OS is appropriate. Anyway, with this setup you can call 
Maven either with:

 mvn -Dlinux clean install

or define this property in the settings.xml. You are even able to test a build 
for a new platform directly:

 mvn -Dcompany.platform=cygwin-gcc clean install



> Transitive Dependencies in a profile are not used
> -------------------------------------------------
>
>                 Key: MNG-1388
>                 URL: https://jira.codehaus.org/browse/MNG-1388
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 2.0
>         Environment: Windows XP using Maven 2.0.
>            Reporter: Damian Bradicich
>             Fix For: Issues to be reviewed 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 was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to