We've tried many different ways of accomplishing this and ultimately
came up with a pretty darn simple solution: we use one of two
build.xml files, depending on whether the project is a "multiproject"
or not.

Here's the single project version:

<?xml version="1.0" encoding="UTF-8"?>
<project default="site" name="anthilled" basedir=".">
  <property environment="env"/>
  <property name="maven.command" value="${env.MAVEN_HOME}/bin/maven"/>
  <target name="site" if="deployDir">
    <exec executable="${maven.command}" failonerror="true">
      <arg value="site"/>
    </exec>
    <copy toDir="${deployDir}">
      <fileset dir="target/docs"/>
    </copy>
  </target>
</project>

Here's the multiproject version:

<?xml version="1.0" encoding="UTF-8"?>
<project default="site" name="anthilled" basedir=".">
  <property environment="env"/>
  <property name="maven.command" value="${env.MAVEN_HOME}/bin/maven"/>
  <target name="site" if="deployDir">
    <exec executable="${maven.command}" failonerror="true">
      <arg value="multiproject:install"/>
    </exec>
    <exec executable="${maven.command}" failonerror="true">
      <arg value="multiproject:site"/>
    </exec>
    <copy toDir="${deployDir}">
      <fileset dir="target/docs"/>
    </copy>
  </target>
</project>

One of those two is included with each of our projects without
modification.  They work as is for any standard maven project.

Note that we don't do anything special with maven.xml, project.xml or
project.properties.  We simply copy the docs to deployDir in the
build.xml script.  Simple, huh?

Good luck,
Jim

Chad Woolley <[EMAIL PROTECTED]> writes:

> Jeff,
>
> The problem is that the publishDir changes (there is a subdirectory
> for each individual build).  So, I can't hardcode a specific location.
>
> I can get at the Anthill publishDir property that is passed in, but I
> don't know how to make this override the "host" and "directory" from
> the maven POM.
>
> The real problem I guess is that the POM entries seem to be immutable,
> unless you specify a variable like
> <directory>${myVar}</directory>. However, (as far as I know) you can
> only set these via System properties on the command line, which I
> don't know how to do when maven is invoked via Anthill.  I've got a
> separate thread going on this specific question (How can I override
> the currentversion from the POM).
>
> I'm probably missing something very obvious here, but I don't know what.
>
> Thanks,
> Chad
>
> Jefferson K. French wrote:
>> Chad,
>> I use AnthillOS and Maven, but publish to a different location and
>> have an entry in navigation.xml that points to the Anthill build logs.
>> Since you can specify the host and directory to which Maven deploys
>> the site, can you not just deploy the site to the Anthill publishDir?
>>   Jeff
>> On Wed, 28 Jul 2004, at 11:32:25 [GMT -0700] Chad Woolley wrote:
>>
>>>> Hi,
>>
>>>> Does anyone out there use Anthill Pro with Maven to manage the automatic
>>>> publishing of their Maven-generated site to the Anthill Intranet?
>>
>>>> There seem to be some hardcoded stuff in the maven site:deploy
>>>> goals which make
>>>> this difficult.  I have written some postGoal hacks, but they are
>>>> ugly, and I
>>>> don't really want to duplicate them across projects, or go to the trouble of
>>>> making a plugin out of them.  Is there a simple solution?
>>
>>>> I would greatly appreciate it if anyone can share their experience
>>>> or code samples.
>>
>>>> Thanks,
>>>> Chad
>> -- 
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to