On 12/11/07, Thorsten Möller <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> my question is regarding activation of profiles based on the <jdk> tag.
> Assume that a POM  specifies two profiles, one that should trigger for JDK
> 1.5.x and one for JDK 1.6.x. The POM would look like this:
> <profile>
>    <activation>
>        <jdk>1.5</jdk>
>    </activation>
> ...
> </profile>
>
> <profile>
>    <activation>
>        <jdk>1.6</jdk>
>    </activation>
> ...
> </profile>
>
>
>
> Based on the documentation that is available from the Maven Web site it is
> unclear to me what the exact semantic of the <jdk> tag is: will it be
> activated for i) all major Versions greather or equal than the one
> specified
> including sub versions or ii) only for the exact major version and all
> subversions. In other words, will a <jdk>1.5</jdk> trigger only for 1.5.y
> versions or also for 1.6.x, 1.7.x, ...? Provided that the latter one holds
> my question then would be "how can I create two profiles -- one for 1.5.x
> and one for 1.6.x -- and make sure that always only one gets activated
> exclusively"?



If you target only two different JDKs, you can use the ! notation so your
POM will be:

<profile>
   <activation>
       <jdk>1.5</jdk>
   </activation>
...
</profile>

<profile>
   <activation>
       <jdk>!1.5</jdk>
   </activation>
...
</profile>

Also from my experience, the fist profile wil not be activated if you run
Maven with a 1.5 or more JDK.

Jeff


Thanks for yor help,
>
> Thorsten
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com

Reply via email to