Files
maven-plugins/site/plugin.jelly
kaz 3a77109f47 Updating some more plugins that were referring to maven.docs.dest
property from the xdoc plugin.  These have been updated to use the new
method of accessing properties in other plugins.  While cleaning this
up, I also noticed a handful of other repetitive properties in
plugin.properties files, which I also removed/cleaned.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112744 13f79535-47bb-0310-9956-ffa450edef68
2003-01-25 18:19:55 +00:00

189 lines
6.6 KiB
XML

<?xml version="1.0"?>
<project
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:m="maven">
<!-- ================================================================== -->
<!-- S I T E G E N E R A T I O N -->
<!-- ================================================================== -->
<goal name="site:generate" prereqs="site"/>
<goal name="site:init" prereqs="xdoc:init">
<j:set var="docsDest"
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/>
</goal>
<goal
name="site"
description="Generate the web site">
<attainGoal name="maven-jdepend-plugin:report"/>
<attainGoal name="maven-checkstyle-plugin:report"/>
<attainGoal name="maven-changelog-plugin:report"/>
<attainGoal name="maven-developer-activity-plugin:report"/>
<attainGoal name="maven-file-activity-plugin:report"/>
<attainGoal name="maven-javadoc-plugin:report"/>
<attainGoal name="maven-jxr-plugin:report"/>
<attainGoal name="maven-junit-report-plugin:report"/>
<attainGoal name="maven-tasklist-plugin:report"/>
<attainGoal name="xdoc"/>
</goal>
<goal name="dyna-site">
<!--
|
| What we have listed are the ids of the plugins that can produce
| reports. So say we have:
|
| <reports>
|
| <report>maven-file-activity</report>
| <report>maven-developer-activity</report>
| </reports>
|
-->
<j:forEach var="report" items="${pom.reports}">
<j:set var="reportGoal" value="${report}:report"/>
<echo>Generating the ${report} ... </echo>
<attainGoal name="${reportGoal}"/>
</j:forEach>
</goal>
<!-- ================================================================== -->
<!-- S I T E D E P L O Y -->
<!-- ================================================================== -->
<goal
name="site:deploy"
description="deploy the generated site docs">
<!--
|
| Generate the site documentation if it has not already been generated.
| We need some markers or timestamps for this so we don't repeat work
| if it's not necessary.
|
-->
<attainGoal name="site"/>
<!--
|
| Deploy the site using the maven.site.deploy.method property (right
| now possible variants are 'fs' and 'ssh')
|
-->
<attainGoal name="site:${maven.site.deploy.method}deploy"/>
</goal>
<!-- ================================================================== -->
<!-- S I T E S S H D E P L O Y -->
<!-- Deploys the site using SSH -->
<!-- ================================================================== -->
<goal name="site:sshdeploy"
prereqs="site:init"
description="Deploy the generated site docs using ssh">
<m:user-check user="${maven.username}"/>
<echo>
siteAddress = ${pom.siteAddress}
siteDirectory = ${pom.siteDirectory}
</echo>
<!-- This needs to taken from the project properties -->
<property name="maven.homepage" value="${pom.siteDirectory}"/>
<tar tarfile="${maven.build.dir}/${maven.final.name}-site.tar" basedir="${docsDest}"/>
<gzip zipfile="${maven.build.dir}/${maven.final.name}-site.tar.gz" src="${maven.build.dir}/${maven.final.name}-site.tar"/>
<delete file="${maven.build.dir}/${maven.final.name}-site.tar"/>
<!-- Make sure the destination directory exists before trying to copy -->
<exec dir="." executable="${maven.ssh.executable}">
<arg line="${pom.siteAddress} -l ${maven.username} 'mkdir -p ${maven.homepage}'"/>
</exec>
<exec dir="${maven.build.dir}" executable="${maven.scp.executable}">
<arg value="${maven.final.name}-site.tar.gz"/>
<arg value="${maven.username}@${pom.siteAddress}:${maven.homepage}"/>
</exec>
<exec dir="." executable="${maven.ssh.executable}">
<arg line="${pom.siteAddress} -l ${maven.username} 'cd ${maven.homepage};gunzip ${maven.final.name}-site.tar.gz;tar xUvf ${maven.final.name}-site.tar;chmod -R g+u *;rm ${maven.final.name}-site.tar'"/>
</exec>
<delete file="${maven.build.dir}/${maven.final.name}-site.tar.gz"/>
</goal>
<!-- ================================================================== -->
<!-- S I T E F S D E P L O Y -->
<!-- Deploys the site by copying to another file system -->
<!-- ================================================================== -->
<goal name="site:fsdeploy"
prereqs="site:init"
description="Deploy the generated site by copying to the site directory">
<echo>
siteAddress = ${pom.siteAddress}
siteDirectory = ${pom.siteDirectory}
</echo>
<!-- copy the site to the directory specified in the project.xml file -->
<copy todir="${pom.siteDirectory}">
<fileset dir="${docsDest}">
<include name="**/*.*"/>
</fileset>
</copy>
</goal>
<goal name="site:war" description="Create a WAR File from the generated site"
prereqs="site:init, site">
<mkdir dir="${docsDest}/WEB-INF" />
<war destfile="${maven.build.dir}/${maven.final.name}-site.war"
webxml="${plugin.resources}/web.xml">
<fileset dir="${docsDest}" />
</war>
</goal>
<goal name="site:ear" prereqs="site:war"
description="Create an EAR File from the generated site">
<j:set var="docType1" value="&lt;" />
<j:set var="docType2">!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'</j:set>
<j:set var="docType3" value="&gt;" />
<mkdir dir="${maven.build.dir}/${plugin.artifactId}" />
<j:set var="warName" value="${maven.final.name}-site.war" />
<copy file="${plugin.resources}/application.xml"
tofile="${maven.build.dir}/${plugin.artifactId}/application.xml"/>
<replace file="${maven.build.dir}/${plugin.artifactId}/application.xml">
<replacefilter token="@name@" value="${pom.artifactId}"/>
<replacefilter token="@shortDescription@"
value="${pom.shortDescription}"/>
<replacefilter token="@warName@" value="${warName}" />
<replacefilter token="@contextRoot@" value="${maven.final.name}" />
</replace>
<ear destfile="${maven.build.dir}/${maven.final.name}-site.ear"
appxml="${maven.build.dir}/${plugin.artifactId}/application.xml">
<fileset dir="${maven.build.dir}" includes="${maven.final.name}-site.war" />
</ear>
</goal>
</project>