How its done: I have a single build.xml (below) for all mavenized
projects sitting in the root of my anthill installation. All maven
projects get set up to use a build/publish script of "..\..\build.xml".
For build, I pass the extra arguments:
-Dmaven.goal=jar:install -Dmaven.project=myprojectname
and for publish:
-Dmaven.goal=site:deploy -Dmaven.project=myprojectname
My maven project.xml has currentVersion set to 'SNAPSHOT', so
developers
only ever make snapshots; anthill is used for nightlies and releases.
<?xml version="1.0" encoding="UTF-8"?>
<project default="maven" name="mavenized" basedir=".">
<property environment="env"/>
<property name="env.MAVEN_HOME" value="C:\Program Files\Maven"/>
<property name="maven.goal" value="jar:install"/>
<property name="maven.project" value="MAVEN_PROJECT_NOT_SET"/>
<property name="maven.dir" value="${basedir}\work\${maven.project}"/>
<target name="maven" >
<echo message="Using MAVEN_HOME=${env.MAVEN_HOME} ${version}"/>
<java classname="com.werken.forehead.Forehead" fork="yes"
maxmemory="128m">
<arg value="-d" />
<arg value="${maven.dir}" />
<arg value="${maven.goal}" />
<classpath>
<pathelement
location="${env.MAVEN_HOME}\lib\forehead-1.0-beta-4.jar" />
</classpath>
<sysproperty key="maven.home" value="${env.MAVEN_HOME}" />
<sysproperty key="tools.jar"
value="${env.JAVA_HOME}\lib\tools.jar" />
<sysproperty key="forehead.conf.file"
value="${env.MAVEN_HOME}\bin\forehead.conf" />
<!-- persuade maven to use anthill's version -->
<sysproperty key="pom.currentVersion" value="${version}"/>
<!-- deploy the site into anthill -->
<sysproperty key="maven.site.deploy.method" value="fs"/>
<sysproperty key="pom.siteDirectory" value="${deployDir}"/>
<sysproperty key="maven.final.name" value="${maven.project}-${version}"/>
</java>
</target>
</project>
YMMV, this works with a mid-december maven b8, patched to return error codes from Forehead (see
http://jira.werken.com/secure/ViewIssue.jspa?key=FOREHEAD-3 )
IIRC classworlds (which replaces forehead in latest maven from CVS) doesnt have this problem, but straight b7 (the current release) does, so you can't detect 'erroneous' builds from a program invoking maven.
The other thing you might want to try in this connection is changing the site plugin to skip failed reports, like so:
<j:catch var="ignore"><attainGoal name="changelog"/></j:catch>
(I don't know if this is still needed in the HEAD version with the new report generation stuff) - anyway, this lets you do site generation even when the code doesnt compile.
Maven's moved on a lot in the last month, I'd give you more current info but I've been sticking with a 'works for me' build for a while...
HTH,
Baz
Sean Langford wrote:
Hello!
Maven is fantastic. I have it set up to run a site:generate nightly and love all the great reports.
Next I would like to try and run maven continously and post a special page showing any build errors should the build fail. Can anyone give me any pointers as to how I might get this done? I'm thinking I could route the build output to a txt file and copy that to docs/index.html should any errors occur. Is this the easiest way to do this?
Thanks
Sean
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
