IMHO, in this case, the dependency should be defined in the profile in the 
consumer POM, with resolved property of the profile.

I don't know if flatten-maven-plugin currently detects such a situation and is 
able to move the parametrized dependency in main section to non-parametrized 
dependency in profile. Or at least detect that the situation is complex and 
require some tricks.

This situation won't happen often, but sure, this will happen and we need to 
define what to do.

Currently, the study in Git did not try to dig into implementation of the 
transformation: but this edge case will be a good one to test.

Regards,

Hervé

Le mercredi 14 mars 2018, 13:21:21 CET Jörg Schaible a écrit :
> Am Mon, 12 Mar 2018 01:12:52 +0100 schrieb Hervé BOUTEMY:
> 
> [snip]
> 
> >> > Why is <profiles/> required for consumers? I'm not aware how profiles
> >> > of a dependency ever play(ed) a role in my "dependent" project?
> >> 
> >> I can remember we had a discussion about that..my first reaction would
> >> be saying no profiles needed in a consumer pom...but I'm not 100%
> >> sure...we need to think that more in detail with different scenarios..
> > 
> > Robert has a strong opinion on this, for profiles activated by OS or JDK
> > version, like flatten-maven-plugin
> 
> How would you solve this case then:
> 
> Somewhere in a parent pom:
> ============== %< =============
>   <profile>
>     <id>linux-amd64</id>
>     <activation>
>       <os>
>       <family>linux</family>
>       <arch>amd64</arch>
>       </os>
>     </activation>
>     <properties>
>       <swt.artifactId>org.eclipse.swt.gtk.linux.x86_64</swt.artifactId>
>     </properties>
>   </profile>
>   <profile>
>     <id>windows-amd64</id>
>     <activation>
>       <os>
>         <family>windows</family>
>         <arch>amd64</arch>
>       </os>
>     </activation>
>     <properties>
>       <swt.artifactId>org.eclipse.swt.win32.win32.x86_64</swt.artifactId>
>     </properties>
>   </profile>
>   <!-- following more variants for supported platforms -->
> ============== %< =============
> 
> Somewhere in a child project X:
> 
> ============== %< =============
>   <dependencies>
>     <dependency>
>       <groupId>org.eclipse.swt</groupId>
>       <artifactId>${swt.artifactId}</artifactId>
>       <version>3.106.0.v20170608-0516</version>
>     </dependency>
>   </dependencies>
> ============== %< =============
> 
> What would a consumer-pom.xml of X look like and how can a client of X
> still depend on the proper dependency for its target platform?
> 
> Cheers,
> Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to