I'm trying to activate a build profile in a project, like:

  <profiles>
    <profile>
      <id>unpack</id>
      <activation>
        <property>
          <name>dev.explode</name>
          <value>yes</value>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            ...
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

Specifying the system property on the command-line like:

mvn package -D dev.explode=yes

seems to trigger the profile o.k. but I would like to have that configured in a build.properties file which gets read by the build. So I've tried the Properties Maven Plugin [1] by including it in the default build:

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0-alpha-2</version>
    <executions>
      <execution>
        <phase>initialize</phase>
        <goals>
          <goal>read-project-properties</goal>
        </goals>
        <configuration>
          <files>
            <file>build.properties</file>
          </files>
        </configuration>
      </execution>
    </executions>
  </plugin>

I didn't appear to have any effect and I've realized project and system properties might be different beasts, and trying to include the property like:

  <properties>
    <dev.explode>yes</dev.explode>
  </properties>

didn't change anything - the profile doesn't get activated. I've further tried moving the execution of the properties plugin to the validate phase, and using its set-system-properties goal:

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0-alpha-2</version>
    <executions>
      <execution>
        <phase>validate</phase>
        <goals>
          <goal>set-system-properties</goal>
        </goals>
        <configuration>
          <properties>
            <property>
              <name>dev.explode</name>
              <value>yes</value>
            </property>
          </properties>
        </configuration>
      </execution>
    </executions>
  </plugin>

with no luck. Does one have experience with using external properties file for the purposes of configuring the activation of profiles?

[1] http://mojo.codehaus.org/properties-maven-plugin/

--
Stanimir

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to