maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christofer Dutz <christofer.d...@c-ware.de>
Subject AW: Artifact with different sets of dependencies switched by profiles
Date Sat, 28 Jun 2014 22:26:19 GMT
No worries :-) 

I was going through the options and I noticed this myself :-)

But is there another option? 
I tried the pom dependency with classifier option, but that didn't work (I wasn't really expecting
it to)

Chris

-----Urspr√ľngliche Nachricht-----
Von: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
Gesendet: Samstag, 28. Juni 2014 22:40
An: Maven Users List
Betreff: Re: Artifact with different sets of dependencies switched by profiles

Noooooooo!!!

Allowing people to define dependencies in profiles was one of the biggest mistakes we made
in Model Version 4.0.0.

The activation rules etc are *never* what they think you are once the dependency is resolved
from the local repository cache.

Please do no do this stupid thing just because we were stupid enough to leave it as an option.


On 28 June 2014 19:24, Christofer Dutz <christofer.dutz@c-ware.de> wrote:

> Hi,
>
> I am currently working on making the Apache Flex project able to 
> release as Maven artifacts. For that I have created a tool that 
> mavenizes a Flex SDK by generating poms and copying and renaming the 
> libraries it consists of. All is working nicely. In contrast to Java 
> in Flex you can sort of choose to use static linking (default) or 
> dynamic linking (rsl). In Flexmojos this is controlled by having a 
> maven scope of "rsl" for dynamically linked libraries.
>
> Static linking:
>                 <dependency>
>                     <groupId>org.apache.flex.framework</groupId>
>                     <artifactId>spark</artifactId>
>                     <version>4.12.1.20140427</version>
>                     <type>swc</type>
>                 </dependency>
>
> Dynamic linking:
>                 <dependency>
>                     <groupId>org.apache.flex.framework</groupId>
>                     <artifactId>spark</artifactId>
>                     <version>4.12.1.20140427</version>
>                     <type>swc</type>
>                     <scope>rsl</scope>
>                 </dependency>
>
> Now I wanted to make it easier for people using Flex so I generated 
> two profiles in my poms. The default one active by default using 
> static linking and one "flex-rsl" using dynamic linking wherever possible.
> I was thinking of enabling that second profile by setting a property:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <project 
> xmlns="http://maven.apache.org/POM/4.0.0">
>     <modelVersion>4.0.0</modelVersion>
>
>     <groupId>org.apache.flex</groupId>
>     <artifactId>framework</artifactId>
>     <version>4.12.1.20140427</version>
>     <packaging>pom</packaging>
>
>     <profiles>
>         <profile>
>             <id>default</id>
>
>             <activation>
>                 <activeByDefault>true</activeByDefault>
>             </activation>
>
>             <dependencies>
>
>                 ... A lot of dependencies ...
>
>             </dependencies>
>         </profile>
>
>         <profile>
>             <id>flex-rsl</id>
>
>             <activation>
>                 <property>
>                     <name>flex.framework.scope</name>
>                     <value>rsl</value>
>                 </property>
>             </activation>
>
>             <dependencies>
>
>                 ... A lot of dependencies ...
>
>             </dependencies>
>         </profile>
>     </profiles>
> </project>
>
> Now I tried activating that second profile by setting that property in 
> the module referencing that pom artifact:
>
> <properties>
>         <flex.version>4.12.1.20140427</flex.version>
>         <!-- Turn on rsl linking of swc dependencies -->
>         <flex.framework.scope>rsl</flex.framework.scope>
> </properties>
>
> <dependencies>
>                 <dependency>
>                     <groupId>org.apache.flex</groupId>
>                     <artifactId>framework</artifactId>
>                     <version>${flex.version}</version>
>                     <type>pom</type>
>                 </dependency>
> </dependencies>
>
> But it seems this doesn't work ... so my question is ... is it 
> possible to do what I want? If not ... is there a way I could achieve 
> this? After all it seems classifiers for pom modules don't seem to exist.
> Or am I wrong here and I could simply generate several pom files 
> "framework-4.12.1.20140427.pom" and "framework-4.12.1.20140427-rsl.pom"?
>
> Chris
>
Mime
View raw message