You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adam Hardy <ad...@cyberspaceroad.com> on 2006/11/03 00:40:59 UTC
Re: [Maven 2.0.4] Profiles
Hi Rémy
just realised I hadn't replied. Very impolite, sorry. Are you still having an
issue with this? What did you want me to try? It sounds you like what you are
saying is that your profiles become active by default just by virtue of their
existence in profiles.xml.
Adam
Rémy Sanlaville on 23/10/06 11:03, wrote:
> Hi Adam,
>
> mvn help:effective-settings
>>
>> will help you determine the problem. Your dev profile would have to be
>> activated by something
>
>
> Nothing in my settings is configure to activate the dev profile.
>
> - try renaming it.
>
>
> I already try it :
>
> --- profiles.xml
> <profilesXml>
> <profiles>
> <profile>
> <id>common</id>
> <properties>
> <profile.common.message>common
> property</profile.common.message>
> </properties>
> </profile>
> <profile>
> <id>foo</id>
> <properties>
> <profile.foo.message>foo
> property</profile.foo.message>
> </properties>
> </profile>
> </profiles>
>
> <activeProfiles>
> <activeProfile>common</activeProfile>
> </activeProfiles>
> </profilesXml>
> --- profiles.xml
>
>> mvn help:active-profiles
>
> The following profiles are active:
>
> - foo (source: profiles.xml)
> - common (source: profiles.xml)
>
> Could you please try it to see if you have the same behaviour ?
>
> It's interesting to notice that with this profiles.xml, it works well.
> But normally, I do not have to add the activation section. Also,
> if you put the profiles section in the pom.xml instead of profiles.xml
> it works well too (without addind the the activation section).
>
> <profilesXml>
> <profiles>
> <profile>
> <id>common</id>
> <properties>
> <profile.common.message>common
> property</profile.common.message>
> </properties>
> </profile>
> <profile>
> <id>dev</id>
> <properties>
> <profile.dev.message>dev
> property</profile.dev.message>
> </properties>
> <activation>
> <property>
> <name>env</name>
> <value>dev</value>
> </property>
> </activation>
> </profile>
> </profiles>
>
> <activeProfiles>
> <activeProfile>common</activeProfile>
> </activeProfiles>
> </profilesXml>
>
>> mvn help:active-profiles
>
> The following profiles are active:
>
> - common (source: profiles.xml)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [Maven 2.0.4] Profiles
Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Rémy Sanlaville wrote:
>>
>> Are you using the maven plugin snapshots repository? If you are, then
>> many of the maven plugins could have been updated.
>
>
> Not directly but others projects yes.
> For information, here, is my test
>
> pom.xml
> -------------
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>test.maven.profiles</groupId>
> <artifactId>test1</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>jar</packaging>
>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <phase>validate</phase>
> <configuration>
> <tasks>
> <echo>${profile.common.message}</echo>
> <echo>${profile.dev.message}</echo>
> </tasks>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
>
> </project>
>
> profiles.xml
> -----------------
> <profilesXml>
> <profiles>
> <profile>
> <id>common</id>
> <properties>
> <profile.common.message>common
> property</profile.common.message>
> </properties>
> </profile>
> <profile>
> <id>dev</id>
> <properties>
> <profile.dev.message>dev
> property</profile.dev.message>
> </properties>
> <activation>
> <property>
> <name>env</name>
> <value>dev</value>
> </property>
> </activation>
> </profile>
> </profiles>
>
> <activeProfiles>
> <activeProfile>common</activeProfile>
> </activeProfiles>
> </profilesXml>
Looks like your operating system memvar activated the dev profile.
My experience with maven is that there are so many variables affecting
operations that you see inexplicable situations like this all the time.
Plus black magic ;)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [Maven 2.0.4] Profiles
Posted by Rémy Sanlaville <re...@gmail.com>.
>
> Are you using the maven plugin snapshots repository? If you are, then
> many of the maven plugins could have been updated.
Not directly but others projects yes.
For information, here, is my test
pom.xml
-------------
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test.maven.profiles</groupId>
<artifactId>test1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<configuration>
<tasks>
<echo>${profile.common.message}</echo>
<echo>${profile.dev.message}</echo>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
profiles.xml
-----------------
<profilesXml>
<profiles>
<profile>
<id>common</id>
<properties>
<profile.common.message>common
property</profile.common.message>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<profile.dev.message>dev
property</profile.dev.message>
</properties>
<activation>
<property>
<name>env</name>
<value>dev</value>
</property>
</activation>
</profile>
</profiles>
<activeProfiles>
<activeProfile>common</activeProfile>
</activeProfiles>
</profilesXml>
Remy
Re: [Maven 2.0.4] Profiles
Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Rémy Sanlaville wrote:
> Hi Adam,
>
> Sorry for the late reply but I was out of my office.
>
> 2006/11/3, Adam Hardy <ad...@cyberspaceroad.com>:
>>
>> It sounds you like what you are
>> saying is that your profiles become active by default just by virtue of
>> their
>> existence in profiles.xml.
>>
> Yes exactly.
>
> But It's strange because i try it again and it works now !
> The following profiles are active:
>
> - common (source: profiles.xml)
>
> I don't know what has been updated.
Are you using the maven plugin snapshots repository? If you are, then
many of the maven plugins could have been updated.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [Maven 2.0.4] Profiles
Posted by Rémy Sanlaville <re...@gmail.com>.
Hi Adam,
Sorry for the late reply but I was out of my office.
2006/11/3, Adam Hardy <ad...@cyberspaceroad.com>:
>
> It sounds you like what you are
> saying is that your profiles become active by default just by virtue of
> their
> existence in profiles.xml.
>
Yes exactly.
But It's strange because i try it again and it works now !
The following profiles are active:
- common (source: profiles.xml)
I don't know what has been updated.
Rémy