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 Crain <ac...@greenenergycorp.com> on 2010/12/22 17:47:54 UTC

dynamic properties and lifecycle question

Hi,

I'm new to maven plugins/lifecycle issues.

I have a dependency that has a classifier that depends on the platform it is
running on (jar contains .so or .dll). I am using a plugin I write to set a
property for the classifier (by asking for OS/architecture/etc).

The plugin works, but it's not running before the classifier is resolved in
the dependency list. The phase "initialize" is described as the time to:

"initialize build state, e.g. set properties or create directories."

What am I missing? It's not really doing anything different then the
"maven-properties-plugin"
that loads properties from a file. Here's a neutralized version of my POM
with relevant sections:

<properties>
    <!--<platform.id>winx86</platform.id>-->
  </properties>
<build>
    <plugins>
      <plugin>
        <groupId>PLUGIN_GROUP_ID</groupId>
        <artifactId>PLUGIN_ARTIFACT_ID</artifactId>
        <version>0.9-SNAPSHOT</version>
        <executions>
          <execution>
            <phase> initialize </phase>
            <goals>
              <goal>properties</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      </plugins>
      <dependencies>

    <dependency>
      <groupId>ART_GROUP_ID</groupId>
      <artifactId>ART_ID</artifactId>
      <version>0.9.2</version>
      <classifier>${platform.id}</classifier>
    </dependency>
</build>

thanks!
Adam