You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by "Springer, Ian P." <ia...@hp.com> on 2004/11/10 23:55:07 UTC

Maven goal for invoking Forrest

In case anyone else has to invoke Forrest from Maven, here is a goal you
can add to yuor maven.xml to do so:

  <property environment="env" />

  <goal name="docs"
        description="generates HTML documentation using Forrest">
    <property name="forrest.home" location="${env.FORREST_HOME}" />
    <property name="forrest.install.dir"
location="${forrest.home}/../.." />
    <property name="forrest.ant.home"
location="${forrest.install.dir}/tools/ant" />
    <java classname="org.apache.tools.ant.Main"
          fork="true"
          failonerror="true"
          maxmemory="128M">       
       <classpath>
         <fileset dir="${forrest.ant.home}/lib">
            <include name="*.jar" />  
         </fileset>
         <pathelement path="${java.home}/../lib/tools.jar" />
       </classpath>
       <sysproperty key="ant.home" value="${forrest.ant.home}" />
       <sysproperty key="forrest.home" value="${forrest.home}" />
       <sysproperty key="basedir" value="${basedir}" />
       <sysproperty key="java.endorsed.dirs"
value="${forrest.install.dir}/lib/endorsed" />
       <arg line="-f ${forrest.home}/forrest.build.xml" />
    </java>
  </goal>

It was necessary to fork a separate java process because Maven 1.0
embeds Ant 1.5.2, but Forrest's forrest.build.xml requires Ant 1.6. The
goal makes use of the copy of Ant 1.6 that is bundled with Forrest, so
it's not even necessary to have Ant 1.6 installed separately.

I hope this helps someone out. Forrest dev team, feel free to add this
to the docs if you think it will be useful.

Ian

Re: Maven goal for invoking Forrest

Posted by Ross Gardler <rg...@apache.org>.
Springer, Ian P. wrote:
> In case anyone else has to invoke Forrest from Maven, here is a goal you
> can add to yuor maven.xml to do so:

Excellent, any chance of writing this up as a How-To for our 
documentation? (see http://forrest.apache.org/howto/howto-howto.html )

A the very least please add it to our issue tracker so that this useful 
information doesn't get lost (I could do that myself but then you 
wouldn't be credited for your valuable contribution).

Ross

> 
>   <property environment="env" />
> 
>   <goal name="docs"
>         description="generates HTML documentation using Forrest">
>     <property name="forrest.home" location="${env.FORREST_HOME}" />
>     <property name="forrest.install.dir"
> location="${forrest.home}/../.." />
>     <property name="forrest.ant.home"
> location="${forrest.install.dir}/tools/ant" />
>     <java classname="org.apache.tools.ant.Main"
>           fork="true"
>           failonerror="true"
>           maxmemory="128M">       
>        <classpath>
>          <fileset dir="${forrest.ant.home}/lib">
>             <include name="*.jar" />  
>          </fileset>
>          <pathelement path="${java.home}/../lib/tools.jar" />
>        </classpath>
>        <sysproperty key="ant.home" value="${forrest.ant.home}" />
>        <sysproperty key="forrest.home" value="${forrest.home}" />
>        <sysproperty key="basedir" value="${basedir}" />
>        <sysproperty key="java.endorsed.dirs"
> value="${forrest.install.dir}/lib/endorsed" />
>        <arg line="-f ${forrest.home}/forrest.build.xml" />
>     </java>
>   </goal>
> 
> It was necessary to fork a separate java process because Maven 1.0
> embeds Ant 1.5.2, but Forrest's forrest.build.xml requires Ant 1.6. The
> goal makes use of the copy of Ant 1.6 that is bundled with Forrest, so
> it's not even necessary to have Ant 1.6 installed separately.
> 
> I hope this helps someone out. Forrest dev team, feel free to add this
> to the docs if you think it will be useful.
> 
> Ian
> 
>