You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mick Knutson <mi...@gmail.com> on 2007/11/29 01:59:33 UTC
[m2] another if/else profile question.
I am trying to achieve:
if (profile == documentation){
modules = this
} else{
modules = this
}
This is what I have:
<profiles>
<profile>
<id>no-doc</id>
<activation>
<activeByDefault/>
</activation>
<modules>
<module>bpel</module>
<module>business-services</module>
<module>common-c2</module>
</modules>
</profile>
<profile>
<id>documentation</id>
<modules>
<module>business-services</module>
<module>common-c2</module>
</modules>
</profile>
</profiles>
but if I run a mvn install it does not get picked up. Only when I run mvn -P
no-doc install does it get picked up.
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---
Re: [m2] another if/else profile question.
Posted by Mick Knutson <mi...@gmail.com>.
I want to always compile the modules in <id>no-doc</id> profile, unless I am
trying to run the <id>documentation</id> profile
On 11/30/07, Wendy Smoak <ws...@gmail.com> wrote:
>
> On Nov 30, 2007 1:09 PM, Mick Knutson <mi...@gmail.com> wrote:
>
> > When I run:
> > mvn -P documentation clean install -e
> >
> > I would assume to NOT run *<module>bpel</module>*
> >
> > But am I missing some syntax?
>
> I don't think you can activate a profile based on a property in the
> pom. Particularly not if the property is in a different profile.
> This has definitely been discussed before, see what you can find in
> the archives.
>
> What problem are you trying to solve?
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---
Re: [m2] another if/else profile question.
Posted by Wendy Smoak <ws...@gmail.com>.
On Nov 30, 2007 1:09 PM, Mick Knutson <mi...@gmail.com> wrote:
> When I run:
> mvn -P documentation clean install -e
>
> I would assume to NOT run *<module>bpel</module>*
>
> But am I missing some syntax?
I don't think you can activate a profile based on a property in the
pom. Particularly not if the property is in a different profile.
This has definitely been discussed before, see what you can find in
the archives.
What problem are you trying to solve?
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] another if/else profile question.
Posted by Mick Knutson <mi...@gmail.com>.
I have this:
<profiles>
<profile>
*<id>documentation</id>*
<properties>
*<test.type>doc</test.type>*
</properties>
<modules>
<module>business-services</module>
<module>common-c2</module>
</modules>
</profile>
<profile>
<id>no-doc</id>
*<activation>
<property>
<name>!test.type</name>
</property>
</activation>*
<modules>
<module>bpel</module>
<module>business-services</module>
<module>common-c2</module>
</modules>
</profile>
</profiles>
When I run:
mvn -P documentation clean install -e
I would assume to NOT run *<module>bpel</module>*
But am I missing some syntax?
On Nov 30, 2007 11:44 AM, Mick Knutson <mi...@gmail.com> wrote:
> I read through this, but how would I say some like (!active.profile ==
> documentation)
>
>
>
>
> On Nov 28, 2007 5:31 PM, Wendy Smoak <ws...@gmail.com> wrote:
>
> > On Nov 28, 2007 6:17 PM, Mick Knutson < mickknutson@gmail.com> wrote:
> >
> > > How do I do the absence of a property?
> >
> > Google turned up... http://www.sonatype.com/book/profiles.html :)
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/BLiNCMagazine
> http://tahoe.baselogic.com
> ---
>
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---
Re: [m2] another if/else profile question.
Posted by Mick Knutson <mi...@gmail.com>.
I read through this, but how would I say some like (!active.profile ==
documentation)
On Nov 28, 2007 5:31 PM, Wendy Smoak <ws...@gmail.com> wrote:
> On Nov 28, 2007 6:17 PM, Mick Knutson <mi...@gmail.com> wrote:
>
> > How do I do the absence of a property?
>
> Google turned up... http://www.sonatype.com/book/profiles.html :)
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---
Re: [m2] another if/else profile question.
Posted by Wendy Smoak <ws...@gmail.com>.
On Nov 28, 2007 6:17 PM, Mick Knutson <mi...@gmail.com> wrote:
> How do I do the absence of a property?
Google turned up... http://www.sonatype.com/book/profiles.html :)
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] another if/else profile question.
Posted by Mick Knutson <mi...@gmail.com>.
How do I do the absence of a property?
On Nov 28, 2007 5:04 PM, Wendy Smoak <ws...@gmail.com> wrote:
> On Nov 28, 2007 5:59 PM, Mick Knutson <mi...@gmail.com> wrote:
> > I am trying to achieve:
> >
> > if (profile == documentation){
> > modules = this
> > } else{
> > modules = this
> > }
> ...
> > <activation>
> > <activeByDefault/>
> > </activation>
> ...
> > but if I run a mvn install it does not get picked up. Only when I run
> mvn -P
> > no-doc install does it get picked up.
>
> It would probably need to be <activeByDefault>true</activeByDefault>.
>
> Another way to do it is to activate the default one on the absence of
> a property, and the other on the presence (or a particular value) of
> the same property.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---
Re: [m2] another if/else profile question.
Posted by Wendy Smoak <ws...@gmail.com>.
On Nov 28, 2007 5:59 PM, Mick Knutson <mi...@gmail.com> wrote:
> I am trying to achieve:
>
> if (profile == documentation){
> modules = this
> } else{
> modules = this
> }
...
> <activation>
> <activeByDefault/>
> </activation>
...
> but if I run a mvn install it does not get picked up. Only when I run mvn -P
> no-doc install does it get picked up.
It would probably need to be <activeByDefault>true</activeByDefault>.
Another way to do it is to activate the default one on the absence of
a property, and the other on the presence (or a particular value) of
the same property.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org