Author: mstruk
Date: 2011-03-08 05:02:01 -0500 (Tue, 08 Mar 2011)
New Revision: 5977
Added:
portal/trunk/packaging/tomcat/pkg/tc6/download-tomcat.xml
portal/trunk/packaging/tomcat/pkg/tc6/extract-download-urls.xsl
portal/trunk/packaging/tomcat/pkg/tc6/package.xml
portal/trunk/packaging/tomcat/pkg/tc7/download-tomcat.xml
portal/trunk/packaging/tomcat/pkg/tc7/extract-download-urls.xsl
portal/trunk/packaging/tomcat/pkg/tc7/package.xml
Modified:
portal/trunk/packaging/tomcat/pkg/tc6/pom.xml
portal/trunk/packaging/tomcat/pkg/tc7/pom.xml
Log:
Added -Pdownload support to Tomcat builds
Added: portal/trunk/packaging/tomcat/pkg/tc6/download-tomcat.xml
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc6/download-tomcat.xml (rev
0)
+++ portal/trunk/packaging/tomcat/pkg/tc6/download-tomcat.xml 2011-03-08 10:02:01 UTC (rev
5977)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="download-tomcat"
xmlns:mvn="http://maven.apache.org/POM/4.0.0">
+
+ <target name="download-tomcat">
+
+ <!-- Fetch tomcat .zip -->
+ <get dest="${dest}" skipexisting="true">
+ <url url="${url}"/>
+ </get>
+
+ <!-- Fetch .md5 file -->
+ <get dest="${dest}.md5" skipexisting="true">
+ <url url="${md5.url}"/>
+ </get>
+
+ <!-- Fix md5 file -->
+ <replaceregexp file="${dest}.md5"
+ match="\s(.*)$"
+ replace=""
+ byline="true"/>
+
+ <!-- Validate checksum -->
+ <local name="checksum.matches"/>
+ <local name="checksum.matches.fail"/>
+ <checksum file="${dest}" algorithm="md5"
fileext=".md5"
+ verifyproperty="checksum.matches"/>
+ <condition property="checksum.matches.fail">
+ <equals arg1="${checksum.matches}" arg2="false"/>
+ </condition>
+ <fail if="checksum.matches.fail">Checksum validation failed! (for:
${dest})</fail>
+
+ </target>
+</project>
\ No newline at end of file
Added: portal/trunk/packaging/tomcat/pkg/tc6/extract-download-urls.xsl
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc6/extract-download-urls.xsl
(rev 0)
+++ portal/trunk/packaging/tomcat/pkg/tc6/extract-download-urls.xsl 2011-03-08 10:02:01
UTC (rev 5977)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<xsl:stylesheet
+ version="1.0"
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ exclude-result-prefixes="str">
+
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:template match="/">
+ <xsl:comment>Generated file</xsl:comment>
+ <tomcat.download>
+ <xsl:for-each select="(//a[./text() = 'zip'])[1]">
+ <xsl:element name="url">
+ <xsl:value-of select="@href"/>
+ </xsl:element>
+ <xsl:element name="dir.name">
+ <xsl:value-of select="@href"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="(//a[./text() = 'md5'])[1]">
+ <xsl:element name="url.md5">
+ <xsl:value-of select="@href"/>
+ </xsl:element>
+ </xsl:for-each>
+ </tomcat.download>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
Copied: portal/trunk/packaging/tomcat/pkg/tc6/package.xml (from rev 5945,
portal/trunk/packaging/jboss-as5/pkg/package.xml)
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc6/package.xml (rev 0)
+++ portal/trunk/packaging/tomcat/pkg/tc6/package.xml 2011-03-08 10:02:01 UTC (rev 5977)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="package"
xmlns:mvn="http://maven.apache.org/POM/4.0.0">
+
+ <target name="package">
+
+ <echo>Using Tomcat at: ${tomcat.dir}</echo>
+
+ <!-- Copy tomcat 6 -->
+ <copy todir="${maven.project.build.directory}/tomcat6">
+ <fileset dir="${tomcat.dir}">
+ <exclude name="webapps/ROOT/**"/>
+ <exclude name="webapps/examples/**"/>
+ <exclude name="webapps/docs/**"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy generic tomcat packaging -->
+ <copy todir="${maven.project.build.directory}/tomcat6">
+ <fileset
dir="${maven.project.build.directory}/../../target/tomcat"/>
+ </copy>
+
+ <!-- Copy specific tomcat configration -->
+ <copy todir="${maven.project.build.directory}/tomcat6"
overwrite="true">
+ <fileset
dir="${maven.project.basedir}/src/main/resources/tomcat"/>
+ </copy>
+
+ <!-- Tomcat 6 specific dependencies -->
+ <copy
+ file="${maven.dependency.org.gatein.wci.wci-tomcat6.jar.path}"
+ todir="${maven.project.build.directory}/tomcat6/lib"/>
+
+ <!-- Tomcat 6 specific configuration -->
+ <copy
+
file="${maven.project.basedir}/src/main/resources/conf/integration/web.xml"
+
todir="${maven.project.build.directory}/tomcat6/webapps/integration/WEB-INF"/>
+
+ <!-- File permissions -->
+ <!-- Excluded due to ARG_MAX limitation on Mac OS X -->
+ <!--chmod perm="0644" type="file"
dir="${project.build.directory}/tomcat6" excludes="**/*.sh"/-->
+ <chmod perm="0755" type="file"
dir="${maven.project.build.directory}/tomcat6"
includes="**/*.sh"/>
+
+ </target>
+</project>
\ No newline at end of file
Modified: portal/trunk/packaging/tomcat/pkg/tc6/pom.xml
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc6/pom.xml 2011-03-08 08:19:36 UTC (rev 5976)
+++ portal/trunk/packaging/tomcat/pkg/tc6/pom.xml 2011-03-08 10:02:01 UTC (rev 5977)
@@ -15,7 +15,9 @@
<name>GateIn for Tomcat 6 packaging</name>
<properties>
-
<tomcat.dir>${exo.projects.directory.dependencies}/${exo.projects.app.tomcat.version}</tomcat.dir>
+
<tomcat.dir>${exo.projects.directory.dependencies}/${exo.projects.app.tomcat.version}</tomcat.dir>
+ <servers.dir>${exo.projects.directory.dependencies}</servers.dir>
+ <tomcat.path>${servers.dir}</tomcat.path>
</properties>
<dependencies>
@@ -56,8 +58,20 @@
</execution>
</executions>
</plugin>
-
<plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.4.1</version>
+ <executions>
+ <execution>
+ <id>auto-clean</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
@@ -70,39 +84,11 @@
</goals>
<configuration>
<target>
- <!-- Copy tomcat 6 -->
- <copy todir="${project.build.directory}/tomcat6">
- <fileset dir="${tomcat.dir}">
- <exclude name="webapps/ROOT/**"/>
- <exclude name="webapps/examples/**"/>
- <exclude name="webapps/docs/**"/>
- </fileset>
- </copy>
-
- <!-- Copy generic tomcat packaging -->
- <copy todir="${project.build.directory}/tomcat6">
- <fileset
dir="${project.build.directory}/../../target/tomcat"/>
- </copy>
-
- <!-- Copy specific tomcat configration -->
- <copy todir="${project.build.directory}/tomcat6"
overwrite="true">
- <fileset
dir="${project.basedir}/src/main/resources/tomcat"/>
- </copy>
-
- <!-- Tomcat 6 specific dependencies -->
- <copy
-
file="${maven.dependency.org.gatein.wci.wci-tomcat6.jar.path}"
- todir="${project.build.directory}/tomcat6/lib"/>
-
- <!-- Tomcat 6 specific configuration -->
- <copy
-
file="${project.basedir}/src/main/resources/conf/integration/web.xml"
-
todir="${project.build.directory}/tomcat6/webapps/integration/WEB-INF"/>
-
- <!-- File permissions -->
- <chmod perm="0644" type="file"
dir="${project.build.directory}/tomcat6" excludes="**/*.sh"/>
- <chmod perm="0755" type="file"
dir="${project.build.directory}/tomcat6" includes="**/*.sh"/>
-
+ <ant antfile="${project.basedir}/package.xml"
inheritRefs="true">
+ <target name="package"/>
+ <property name="maven.project.basedir"
value="${project.basedir}"/>
+ <property name="maven.project.build.directory"
value="${project.build.directory}"/>
+ </ant>
</target>
</configuration>
</execution>
@@ -113,6 +99,109 @@
<profiles>
<profile>
+ <id>download</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tomcat-check-environment-ready</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <id>prepare-package</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <!-- Autocreate servers.dir if necessary -->
+ <mkdir dir="${tomcat.path}"/>
+
+ <!-- Fetch tomcat6 mirror url, then .zip -->
+ <get dest="${project.build.directory}/mirror.xml"
skipexisting="true">
+ <url
url="http://tomcat.apache.org/download-60.cgi"/>
+ </get>
+
+ <replaceregexp
file="${project.build.directory}/mirror.xml"
+ match="<!DOCTYPE(.*)>"
+ replace=""
+ byline="true"/>
+
+ <xslt
+ basedir="${project.build.directory}"
+ destdir="${project.build.directory}"
+ includes="mirror.xml"
+ extension=".xml"
+
style="${project.basedir}/extract-download-urls.xsl">
+
+ <mapper type="glob" from="mirror.xml"
to="download-urls.xml"/>
+ </xslt>
+
+ <replaceregexp
file="${project.build.directory}/download-urls.xml"
+
match="<dir.name>(.*)/apache-tomcat-(.*).zip</dir.name>"
+
replace="<dir.name>apache-tomcat-\2</dir.name>"
+ byline="true"/>
+
+ <xmlproperty
file="${project.build.directory}/download-urls.xml"/>
+
+ <basename file="${tomcat.download.url}"
property="tomcat.file.name"/>
+ <property name="tomcat.zip"
+ value="${tomcat.path}/${tomcat.file.name}"/>
+ <property name="tomcat.dir.effective"
+
value="${tomcat.path}/${tomcat.download.dir.name}"/>
+
+ <available property="tomcat.dir.exists"
type="dir" file="${tomcat.dir.effective}"/>
+
+ <!-- echoproperties / -->
+
+ <fail if="tomcat.dir.exists">
+"
+Destination Tomcat directory exists already:
+ ${tomcat.dir.effective}
+
+Either rename it, delete it, or deactivate -Pdownload profile.
+"
+ </fail>
+
+ <!-- Download Tomcat unless already downloaded -->
+ <ant
antfile="${project.basedir}/download-tomcat.xml">
+ <target name="download-tomcat"/>
+ <property name="url"
value="${tomcat.download.url}"/>
+ <property name="md5.url"
value="${tomcat.download.url.md5}"/>
+ <property name="dest"
value="${tomcat.zip}"/>
+ </ant>
+
+ <!-- Extract downloaded Tomcat to servers dir -->
+ <unzip src="${tomcat.zip}"
dest="${tomcat.path}" overwrite="false"/>
+
+ <ant antfile="${project.basedir}/package.xml"
inheritRefs="true">
+ <target name="package"/>
+ <property name="tomcat.dir"
value="${tomcat.dir.effective}"/>
+ <property name="maven.project.basedir"
value="${project.basedir}"/>
+ <property name="maven.project.build.directory"
value="${project.build.directory}"/>
+ </ant>
+
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>bundle</id>
<build>
<plugins>
@@ -129,7 +218,8 @@
</goals>
<configuration>
<target>
- <zip destfile="${project.build.directory}/tomcat6.zip"
basedir="${project.build.directory}/tomcat6"/>
+ <zip destfile="${project.build.directory}/tomcat6.zip"
+ basedir="${project.build.directory}/tomcat6"/>
<attachartifact
file="${project.build.directory}/tomcat6.zip" classifier="bundle"
type="zip"/>
</target>
</configuration>
@@ -140,5 +230,5 @@
</build>
</profile>
</profiles>
-
+
</project>
\ No newline at end of file
Added: portal/trunk/packaging/tomcat/pkg/tc7/download-tomcat.xml
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc7/download-tomcat.xml (rev
0)
+++ portal/trunk/packaging/tomcat/pkg/tc7/download-tomcat.xml 2011-03-08 10:02:01 UTC (rev
5977)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="download-tomcat"
xmlns:mvn="http://maven.apache.org/POM/4.0.0">
+
+ <target name="download-tomcat">
+
+ <!-- Fetch tomcat .zip -->
+ <get dest="${dest}" skipexisting="true">
+ <url url="${url}"/>
+ </get>
+
+ <!-- Fetch .md5 file -->
+ <get dest="${dest}.md5" skipexisting="true">
+ <url url="${md5.url}"/>
+ </get>
+
+ <!-- Fix md5 file -->
+ <replaceregexp file="${dest}.md5"
+ match="\s(.*)$"
+ replace=""
+ byline="true"/>
+
+ <!-- Validate checksum -->
+ <local name="checksum.matches"/>
+ <local name="checksum.matches.fail"/>
+ <checksum file="${dest}" algorithm="md5"
fileext=".md5"
+ verifyproperty="checksum.matches"/>
+ <condition property="checksum.matches.fail">
+ <equals arg1="${checksum.matches}" arg2="false"/>
+ </condition>
+ <fail if="checksum.matches.fail">Checksum validation failed! (for:
${dest})</fail>
+
+ </target>
+</project>
\ No newline at end of file
Added: portal/trunk/packaging/tomcat/pkg/tc7/extract-download-urls.xsl
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc7/extract-download-urls.xsl
(rev 0)
+++ portal/trunk/packaging/tomcat/pkg/tc7/extract-download-urls.xsl 2011-03-08 10:02:01
UTC (rev 5977)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<xsl:stylesheet
+ version="1.0"
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ exclude-result-prefixes="str">
+
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:template match="/">
+ <xsl:comment>Generated file</xsl:comment>
+ <tomcat.download>
+ <xsl:for-each select="(//a[./text() = 'zip'])[1]">
+ <xsl:element name="url">
+ <xsl:value-of select="@href"/>
+ </xsl:element>
+ <xsl:element name="dir.name">
+ <xsl:value-of select="@href"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="(//a[./text() = 'md5'])[1]">
+ <xsl:element name="url.md5">
+ <xsl:value-of select="@href"/>
+ </xsl:element>
+ </xsl:for-each>
+ </tomcat.download>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
Added: portal/trunk/packaging/tomcat/pkg/tc7/package.xml
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc7/package.xml (rev 0)
+++ portal/trunk/packaging/tomcat/pkg/tc7/package.xml 2011-03-08 10:02:01 UTC (rev 5977)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="package"
xmlns:mvn="http://maven.apache.org/POM/4.0.0">
+
+ <target name="package">
+
+ <echo>Using Tomcat at: ${tomcat.dir}</echo>
+
+ <!-- Copy tomcat 7 -->
+ <copy todir="${maven.project.build.directory}/tomcat7">
+ <fileset dir="${tomcat.dir}">
+ <exclude name="webapps/ROOT/**"/>
+ <exclude name="webapps/examples/**"/>
+ <exclude name="webapps/docs/**"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy generic tomcat packaging -->
+ <copy todir="${maven.project.build.directory}/tomcat7">
+ <fileset
dir="${maven.project.build.directory}/../../target/tomcat"/>
+ </copy>
+
+ <!-- Copy specific tomcat configration -->
+ <copy todir="${maven.project.build.directory}/tomcat7"
overwrite="true">
+ <fileset
dir="${maven.project.basedir}/src/main/resources/tomcat"/>
+ </copy>
+
+ <!-- Tomcat 7 specific dependencies -->
+ <copy
+ file="${maven.dependency.org.gatein.wci.wci-tomcat7.jar.path}"
+ todir="${maven.project.build.directory}/tomcat7/lib"/>
+
+ <!-- Tomcat 7 specific configuration -->
+ <copy
+
file="${maven.project.basedir}/src/main/resources/conf/integration/web.xml"
+
tofile="${maven.project.build.directory}/tomcat7/webapps/integration/WEB-INF/web.xml"/>
+
+ <!-- File permissions -->
+ <!-- Excluded due to ARG_MAX limitation on Mac OS X -->
+ <!--chmod perm="0644" type="file"
dir="${project.build.directory}/tomcat7" excludes="**/*.sh"/-->
+ <chmod perm="0755" type="file"
dir="${maven.project.build.directory}/tomcat7"
includes="**/*.sh"/>
+
+ </target>
+</project>
\ No newline at end of file
Modified: portal/trunk/packaging/tomcat/pkg/tc7/pom.xml
===================================================================
--- portal/trunk/packaging/tomcat/pkg/tc7/pom.xml 2011-03-08 08:19:36 UTC (rev 5976)
+++ portal/trunk/packaging/tomcat/pkg/tc7/pom.xml 2011-03-08 10:02:01 UTC (rev 5977)
@@ -15,7 +15,9 @@
<name>GateIn for Tomcat 7 packaging</name>
<properties>
-
<tomcat.dir>${exo.projects.directory.dependencies}/${exo.projects.app.tomcat7.version}</tomcat.dir>
+
<tomcat.dir>${exo.projects.directory.dependencies}/${exo.projects.app.tomcat7.version}</tomcat.dir>
+ <servers.dir>${exo.projects.directory.dependencies}</servers.dir>
+ <tomcat.path>${servers.dir}</tomcat.path>
</properties>
<dependencies>
@@ -56,8 +58,20 @@
</execution>
</executions>
</plugin>
-
<plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.4.1</version>
+ <executions>
+ <execution>
+ <id>auto-clean</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
@@ -70,40 +84,11 @@
</goals>
<configuration>
<target>
-
- <!-- Copy tomcat 7 -->
- <copy todir="${project.build.directory}/tomcat7">
- <fileset dir="${tomcat.dir}">
- <exclude name="webapps/ROOT/**"/>
- <exclude name="webapps/examples/**"/>
- <exclude name="webapps/docs/**"/>
- </fileset>
- </copy>
-
- <!-- Copy generic tomcat packaging -->
- <copy todir="${project.build.directory}/tomcat7">
- <fileset
dir="${project.build.directory}/../../target/tomcat"/>
- </copy>
-
- <!-- Copy specific tomcat configration -->
- <copy todir="${project.build.directory}/tomcat7"
overwrite="true">
- <fileset
dir="${project.basedir}/src/main/resources/tomcat"/>
- </copy>
-
- <!-- Tomcat 7 specific dependencies -->
- <copy
-
file="${maven.dependency.org.gatein.wci.wci-tomcat7.jar.path}"
- todir="${project.build.directory}/tomcat7/lib"/>
-
- <!-- Tomcat 7 specific configuration -->
- <copy
-
file="${project.basedir}/src/main/resources/conf/integration/web.xml"
-
tofile="${project.build.directory}/tomcat7/webapps/integration/WEB-INF/web.xml"/>
-
- <!-- File permissions -->
- <chmod perm="0644" type="file"
dir="${project.build.directory}/tomcat7" excludes="**/*.sh"/>
- <chmod perm="0755" type="file"
dir="${project.build.directory}/tomcat7" includes="**/*.sh"/>
-
+ <ant antfile="${project.basedir}/package.xml"
inheritRefs="true">
+ <target name="package"/>
+ <property name="maven.project.basedir"
value="${project.basedir}"/>
+ <property name="maven.project.build.directory"
value="${project.build.directory}"/>
+ </ant>
</target>
</configuration>
</execution>
@@ -114,6 +99,109 @@
<profiles>
<profile>
+ <id>download</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tomcat-check-environment-ready</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <id>prepare-package</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <!-- Autocreate servers.dir if necessary -->
+ <mkdir dir="${tomcat.path}"/>
+
+ <!-- Fetch tomcat7 mirror url, then .zip -->
+ <get dest="${project.build.directory}/mirror.xml"
skipexisting="true">
+ <url
url="http://tomcat.apache.org/download-70.cgi"/>
+ </get>
+
+ <replaceregexp
file="${project.build.directory}/mirror.xml"
+ match="<!DOCTYPE(.*)>"
+ replace=""
+ byline="true"/>
+
+ <xslt
+ basedir="${project.build.directory}"
+ destdir="${project.build.directory}"
+ includes="mirror.xml"
+ extension=".xml"
+
style="${project.basedir}/extract-download-urls.xsl">
+
+ <mapper type="glob" from="mirror.xml"
to="download-urls.xml"/>
+ </xslt>
+
+ <replaceregexp
file="${project.build.directory}/download-urls.xml"
+
match="<dir.name>(.*)/apache-tomcat-(.*).zip</dir.name>"
+
replace="<dir.name>apache-tomcat-\2</dir.name>"
+ byline="true"/>
+
+ <xmlproperty
file="${project.build.directory}/download-urls.xml"/>
+
+ <basename file="${tomcat.download.url}"
property="tomcat.file.name"/>
+ <property name="tomcat.zip"
+ value="${tomcat.path}/${tomcat.file.name}"/>
+ <property name="tomcat.dir.effective"
+
value="${tomcat.path}/${tomcat.download.dir.name}"/>
+
+ <available property="tomcat.dir.exists"
type="dir" file="${tomcat.dir.effective}"/>
+
+ <!-- echoproperties / -->
+
+ <fail if="tomcat.dir.exists">
+"
+Destination Tomcat directory exists already:
+ ${tomcat.dir.effective}
+
+Either rename it, delete it, or deactivate -Pdownload profile.
+"
+ </fail>
+
+ <!-- Download Tomcat unless already downloaded -->
+ <ant
antfile="${project.basedir}/download-tomcat.xml">
+ <target name="download-tomcat"/>
+ <property name="url"
value="${tomcat.download.url}"/>
+ <property name="md5.url"
value="${tomcat.download.url.md5}"/>
+ <property name="dest"
value="${tomcat.zip}"/>
+ </ant>
+
+ <!-- Extract downloaded Tomcat to servers dir -->
+ <unzip src="${tomcat.zip}"
dest="${tomcat.path}" overwrite="false"/>
+
+ <ant antfile="${project.basedir}/package.xml"
inheritRefs="true">
+ <target name="package"/>
+ <property name="tomcat.dir"
value="${tomcat.dir.effective}"/>
+ <property name="maven.project.basedir"
value="${project.basedir}"/>
+ <property name="maven.project.build.directory"
value="${project.build.directory}"/>
+ </ant>
+
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
<id>bundle</id>
<build>
<plugins>