Just to answere my own question.
I used maven-antrun-plugin. The verify phase is followed with a delete
SUCCESS (a file acting aka our flag) command. The install phase is
followed with a create file (ant touch) command.
Super POM
----------
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>delete</id>
<phase>validate</phase>
<configuration>
<tasks>
<taskdef
resource="net/sf/antcontrib/antcontrib.properties">
<classpath
refid="maven.plugin.classpath"/>
</taskdef>
<if>
<equals
arg1="${successPath}" arg2="$${successPath}" /><!--Not set, and
additional $ to escape the property-->
<then>
<!--echo
message="The value of property successPath is ${successPath}" /-->
</then>
<else>
<!--echo
message="The value of property successPath is ${successPath}" /-->
<property
name="success.file" value="${successPath}/SUCCESS"/>
<echo
message="Delete file ${success.file}"/>
<delete
file="${success.file}"/>
</else>
</if>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>create</id>
<phase>install</phase>
<configuration>
<tasks>
<taskdef
resource="net/sf/antcontrib/antcontrib.properties">
<classpath
refid="maven.plugin.classpath"/>
</taskdef>
<if>
<equals
arg1="${successPath}" arg2="$${successPath}" /><!--Not set, and
additional $ to escape the property-->
<then>
<!--echo
message="The value of property successPath is ${successPath}" /-->
</then>
<else>
<!--echo
message="The value of property successPath is ${successPath}" /-->
<property
name="success.file" value="${successPath}/SUCCESS"/>
<echo
message="Create file ${success.file}"/>
<touch
file="${success.file}"/>
</else>
</if>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
To use provide property successPath:
mvn install -DsuccessPath=/local/users/continuum/xxx
Then check the SUCCESS file from the ant script or whatever that has a
dependency to this maven buildt artifacts. If SUCCESS exists the build
was successful else there was somthing wrong.
The -DsuccessPath will be added to continuum where our SuperPOM is
beeing buildt.
-Ronny
-----Opprinnelig melding-----
Fra: Naess, Ronny [mailto:[EMAIL PROTECTED]
Sendt: 25. oktober 2006 11:31
Til: Maven Users List
Emne: How to flag successful build
We use continuum to build all server projects (maven) and client
projects(Bea Workshop project buildt with Ant).
We want to deploy the ear buildt from the workshopproject to out
testserver (weblogic).
The clue is to deploy only if server projects is successfully buildt.
The ant script (workshop) should then check for a flag (SUCCESS) before
deployment.
How can we flag success full build from maven. I tried to use antrun to
create a SUCCESS file after installphase and delete the same file after
validatephase, but this does not work since parent-pom is handled as a
separate project. This means while parent deletes the SUCCESS file it
also creates the file before the modules starts to do the same.
Is there a smart way to solve this?
-Ronny
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]