Em 9 de março de 2012 11:15, Gustavo Leite de Mendonça Chaves
<[email protected]> escreveu:
>
> But, perhaps, we could at least detect it by implementing a plugin to 
> validate the artifact
> version in the validate phase of the default lifecycle. It could abort
> the build early on if the artifact version contains an unexpanded
> property, for instance.

This can be checked with the
http://maven.apache.org/plugins/maven-enforcer-plugin/. For instance,
if the artifact's version is defined like this:

    <version>${scm.version}</version>

Then, the plugin could enforce it like this:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <id>enforce-property</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireProperty>
                  <property>project.version</property>
                  <message>"Please, use -Dscm.version=VERSION to
specify the artifact's version."</message>
                </requireProperty>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

--
Gustavo

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to