Finally got maven+anthill working together, more details below, hope folk find this useful - it works reasonably well. One thing I still need to make this fully integrated is to get maven to use the version number supplied by anthill. I'm trying to pass in "-Dpom.currentVersion=1.0.13" (for example), but its getting ignored and I get the version from the project.xml. Other properties, like pom.siteDirectory, seem to work. This is b7 - is there a bug? Or have I got the name of the property wrong?

Cheers,
-Baz

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}"/>
</java>
</target>

</project>


Brian Ewins wrote:
I'm looking to set up automated/nightly builds for my org. (like everyone else!) I'd appreciate hearing about other's experiences.

I'm looking into using Anthill, because we have multiple projects (crosses off CruiseControl), are currently using VSS (sigh - crosses off Gump), and we want to see build logs when the build fails (currently this rules out using Maven directly - it produces no log for java:jar, and in b7 the site won't build if the code doesn't build; anyway we still need to build the ant projects)

My plan for the mavenized stuff is to write a simple build.xml that just invokes maven[1].

Anyone know of problems with a setup like this, or know a better way to do it?

Cheers,
Baz

[1] something like this...not tested this yet:
<property environment="env"/>
<target name="maven">
<java classname="com.werken.forehead.Forehead">
<arg>some-goal-here</arg>
<jvmarg>-Xmx128m</jvmarg>
<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" />
</java>
</target>


--
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]>

Reply via email to