You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2005/09/05 09:58:46 UTC

[m2] Default profile working?

Hi,

I want to allow cargo build users to override a plugin property. I have seen
that using a <build> element is not allowed in a settings.xml file and Brett
has suggested I use a <properties> element instead. However I also need to
define a default value for the property that can be overridden.

Thus I have defined the following in my project's pom.xml:

[...]
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemProperties combine.children="append">
            <property>
              <name>cargo.containers</name>
              <value>${cargo.containers}</value>
            </property>
[...]
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>default</id>
      <properties>
        <cargo.containers>jetty4xEmbedded</cargo.containers>
      </properties>
    </profile>
  </profiles>
</project>

I want cargo build users to be able to create a settings.xml file with the
following for example:

<settings>
  <profiles>
    <profile>
      <id>user-vmassol</id>
      <properties>
        <cargo.containers>resin3x</cargo.containers>
      </properties>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>user-vmassol</activeProfile>
  </activeProfiles>
</settings>

Is that the correct way to implement my use case?

So far, the issue I've had is that the default profile created in pom.xml is
not used when I issue a "m2 install" command. I've read on
http://docs.codehaus.org/display/MAVEN/Build+Profiles that naming a profile
"default" will automatically activate it. Isn't that so?

If not how can I activate a profile defined in pom.xml by default?

Thanks a lot
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [m2] Default profile working?

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Kenney,

> -----Original Message-----
> From: Kenney Westerhof [mailto:forge@neonics.com]
> Sent: lundi 5 septembre 2005 10:31
> To: Maven Developers List
> Subject: Re: [m2] Default profile working?

[snip]

> AFAIK all profiles that don't have an 'activation' were automatically
> enabled (that is, profiles in settings.xml).
> That might have changed. You can run
>   m2 projecthelp:active-profiles
> and
>   m2 projecthelp:effective-settings
> to see what m2 is considering active settings.

Thanks. I've tried that and it shows that the profile is not being taken
into account. See http://jira.codehaus.org/browse/MNG-835.

-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [m2] Default profile working?

Posted by Kenney Westerhof <fo...@neonics.com>.
On Mon, 5 Sep 2005, Vincent Massol wrote:

Hi,

> Hi,


[snip]

>           <systemProperties combine.children="append">
>             <property>
>               <name>cargo.containers</name>
>               <value>${cargo.containers}</value>
>             </property>
> [...]
>           </systemProperties>

That's new to me...

>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <profiles>
>     <profile>
>       <id>default</id>
>       <properties>
>         <cargo.containers>jetty4xEmbedded</cargo.containers>
>       </properties>
>     </profile>
>   </profiles>
> </project>


Profiles ought to be merged with the default build; however I believe
there are currently some issues with that.

> I want cargo build users to be able to create a settings.xml file with the
> following for example:
>
> <settings>
>   <profiles>
>     <profile>
>       <id>user-vmassol</id>
>       <properties>
>         <cargo.containers>resin3x</cargo.containers>
>       </properties>
>     </profile>
>   </profiles>
>   <activeProfiles>
>     <activeProfile>user-vmassol</activeProfile>
>   </activeProfiles>
> </settings>
>
> Is that the correct way to implement my use case?

It should be (more or less).

> So far, the issue I've had is that the default profile created in pom.xml is
> not used when I issue a "m2 install" command. I've read on
> http://docs.codehaus.org/display/MAVEN/Build+Profiles that naming a profile
> "default" will automatically activate it. Isn't that so?

AFAIK all profiles that don't have an 'activation' were automatically
enabled (that is, profiles in settings.xml).
That might have changed. You can run
  m2 projecthelp:active-profiles
and
  m2 projecthelp:effective-settings
to see what m2 is considering active settings.


-- Kenney

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org