dion 2002/06/13 18:31:44
Modified: src/templates/build/plugins/j2ee default.properties
build.xml Control.vm
Added: src/templates/build/plugins/j2ee build-appserver-proxy.xml
Log:
appserver patch from pete lynch
Revision Changes Path
1.5 +67 -0
jakarta-turbine-maven/src/templates/build/plugins/j2ee/default.properties
Index: default.properties
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/j2ee/default.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- default.properties 25 May 2002 11:55:09 -0000 1.4
+++ default.properties 14 Jun 2002 01:31:44 -0000 1.5
@@ -45,3 +45,70 @@
#maven.j2ee.ejb.remote.includes=**/interfaces/*
#maven.j2ee.ejb.remote.excludes=**/interfaces/*Local*.class
+
+
+#############################################################################
+# A P P S E R V E R
+#----------------------------------------------------------------------------
+
+#
+# used to let the appserver build scripts know which version of j2ee we are
+# running against
+#
+maven.j2ee.version=13
+
+#
+# the place where the main install of the application server resides
+#
+maven.appserver.home=/apps/jakarta-tomcat-4
+
+#
+# a supported name of an application server instance to install
+#
+maven.appserver.name=tomcat
+
+#
+# version number of the application server, in the form of ##
+#
+maven.appserver.version=40
+
+#
+# ports to access this server instance
+#
+maven.appserver.port.http=8082
+maven.appserver.port.https=8083
+maven.appserver.port.one=8087
+maven.appserver.port.two=8088
+maven.appserver.port.three=8089
+
+#
+# where to install the local instance of the server
+#
+maven.appserver.dir=${basedir}/server
+
+#
+# files in an 'includes' pattern to include when controlling the server
+# For example, if you have classes in your classpath you would like to
+# include when starting the server, you could use
+# maven.appserver.classpath=${java.class.path}
+# paths can be absolute or relative to ${maven.appserver.dir} as that is
+# where a jvm will be started. This is common for libraries that need sharing
+# across all webapps installed in the server
+#
+maven.appserver.classpath=
+
+#
+# The host name, used when configuring, defaults to localhost
+#
+maven.appserver.host=localhost
+
+#
+# The URL used to test the current running status of the appserver
+#
+maven.appserver.url=http://${maven.appserver.host}:${maven.appserver.port.http}/index.html
+
+
+
+
+
+
1.19 +350 -86 jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml
Index: build.xml
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- build.xml 10 Jun 2002 09:49:43 -0000 1.18
+++ build.xml 14 Jun 2002 01:31:44 -0000 1.19
@@ -13,36 +13,36 @@
<pathelement location="${lib.repo}/maven.jar"/>
</classpath>
</taskdef>
-
+
<create-classpath
listFile="${maven.home}/plugins/core/jars.list"
reference="pre-maven-classpath"
baseDir="${lib.repo}"
/>
-
+
<path id="maven-classpath">
<path refid="pre-maven-classpath"/>
<pathelement location="${lib.repo}/maven.jar"/>
</path>
-
+
<!-- define maven taskdefs, as taskdefs are not yet inheritable? -->
<taskdef resource="maven-taskdefs.properties">
<classpath refid="maven-classpath" />
</taskdef>
<property name="maven.init" value="true" />
-
+
<!-- call common build file initialization to verify project, update jars
load project and default properties etc -->
<maven-ant antfile="${maven.home}/plugins/core/build-init.xml"
- target="verify-project"
- inheritAll="true"
- inheritRefs="true"
+ target="verify-project"
+ inheritAll="true"
+ inheritRefs="true"
exportAll="true"
exportRefs="true"/>
-
+
</target>
-
+
<!-- ================================================================== -->
<!-- L O C A L I N I T -->
<!-- ================================================================== -->
@@ -50,7 +50,7 @@
<target name="local-init" depends="init">
<!-- Pick up tool specific defaults -->
<property file="${maven.home}/plugins/j2ee/default.properties"/>
-
+
<!-- ear -->
<condition property="maven.j2ee.callback.pre-ear.ok">
<and>
@@ -61,7 +61,7 @@
</not>
</and>
</condition>
-
+
<condition property="maven.j2ee.callback.post-ear.ok">
<and>
<available file="${maven.j2ee.callback.post-ear.buildFile}"/>
@@ -71,7 +71,7 @@
</not>
</and>
</condition>
-
+
<!-- ejb -->
<condition property="maven.j2ee.callback.pre-ejb.ok">
<and>
@@ -82,7 +82,7 @@
</not>
</and>
</condition>
-
+
<condition property="maven.j2ee.callback.post-ejb.ok">
<and>
<available file="${maven.j2ee.callback.post-ejb.buildFile}"/>
@@ -92,7 +92,7 @@
</not>
</and>
</condition>
-
+
<!-- validate-war -->
<condition property="maven.j2ee.callback.pre-validate-war.ok">
<and>
@@ -103,7 +103,7 @@
</not>
</and>
</condition>
-
+
<condition property="maven.j2ee.callback.post-validate-war.ok">
<and>
<available file="${maven.j2ee.callback.post-validate-war.buildFile}"/>
@@ -113,7 +113,7 @@
</not>
</and>
</condition>
-
+
<!-- war -->
<condition property="maven.j2ee.callback.pre-war.ok">
<and>
@@ -124,7 +124,7 @@
</not>
</and>
</condition>
-
+
<condition property="maven.j2ee.callback.post-war.ok">
<and>
<available file="${maven.j2ee.callback.post-war.buildFile}"/>
@@ -140,13 +140,13 @@
<!-- ================================================================== -->
<!-- W A R -->
<!-- ================================================================== -->
-
+
<!-- build a war file -->
<target name="war" depends="local-init, war-init, war-error,
pre-war-callback, war-build, post-war-callback"
description="o Create a war file" />
-
- <!-- check to make sure all files and properties are available -->
+
+ <!-- check to make sure all files and properties are available -->
<target name="war-init">
<condition property="maven.j2ee.war.ready">
<and>
@@ -158,8 +158,8 @@
<available file="${maven.j2ee.war.webxml}" type="file"/>
</and>
</condition>
- </target>
-
+ </target>
+
<!-- print failure message if files and properties not available -->
<target name="war-error" unless="maven.j2ee.war.ready">
<fail>
@@ -182,22 +182,22 @@
+------------------------------------------------------------------------------
</fail>
</target>
-
+
<!-- process any user specified pre-war callback -->
<target name="pre-war-callback" if="maven.j2ee.callback.pre-war.ok">
- <maven-ant antfile="${maven.j2ee.callback.pre-war.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.pre-war.buildFile}"
target="${maven.j2ee.callback.pre-war.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
-
+
<!-- build the war file from the various sources -->
<target name="war-build">
<!-- make sure the source is compiled -->
- <maven-ant antfile="${maven.home}/plugins/core/build.xml"
+ <maven-ant antfile="${maven.home}/plugins/core/build.xml"
inheritRefs="true" exportAll="false" exportRefs="false" target="jar" />
<echo>Building WAR ${maven.j2ee.war.name}</echo>
-
+
<war warfile="${maven.build.dir}/${maven.j2ee.war.name}.war"
webxml="${maven.j2ee.war.webxml}">
<fileset dir="${maven.j2ee.war.content}"/>
@@ -216,24 +216,24 @@
<attribute name="Built-By" value="${user.name}" />
<section name="${maven.package}">
<attribute name="Specification-Title" value="${maven.id}" />
- <attribute name="Specification-Version"
+ <attribute name="Specification-Version"
value="${maven.currentVersion}" />
- <attribute name="Specification-Vendor"
+ <attribute name="Specification-Vendor"
value="${maven.organization}" />
- <attribute name="Implementation-Title"
+ <attribute name="Implementation-Title"
value="${maven.package}" />
- <attribute name="Implementation-Version"
+ <attribute name="Implementation-Version"
value="${maven.currentVersion}" />
- <attribute name="Implementation-Vendor"
+ <attribute name="Implementation-Vendor"
value="${maven.organization}" />
</section>
</manifest>
</war>
</target>
-
+
<!-- process any user specified post-war callback -->
<target name="post-war-callback" if="maven.j2ee.callback.post-war.ok">
- <maven-ant antfile="${maven.j2ee.callback.post-war.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.post-war.buildFile}"
target="${maven.j2ee.callback.post-war.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
@@ -251,7 +251,7 @@
<available file="${maven.build.dir}/${maven.j2ee.war.name}.war" />
</condition>
</target>
-
+
<!-- fail if the war file doesn't exist -->
<target name="validate-war-error" unless="maven.j2ee.war-validator.ready">
<fail>
@@ -269,18 +269,18 @@
+------------------------------------------------------------------------------
</fail>
</target>
-
+
<!-- process any user specified pre-validate war callback -->
<target name="pre-validate-war-callback"
if="maven.j2ee.callback.pre-validate-war.ok">
- <maven-ant antfile="${maven.j2ee.callback.pre-validate-war.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.pre-validate-war.buildFile}"
target="${maven.j2ee.callback.pre-validate-war.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
<!-- perform the validation using our custom task -->
<target name="validate">
-
+
<warvalidator warFileName="${maven.build.dir}/${maven.j2ee.war.name}.war">
<formatter type="plain" usefile="false"/>
</warvalidator>
@@ -290,17 +290,17 @@
<!-- process any user specified post-validate war callback -->
<target name="post-validate-war-callback"
if="maven.j2ee.callback.post-validate-war.ok">
- <maven-ant antfile="${maven.j2ee.callback.post-validate-war.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.post-validate-war.buildFile}"
target="${maven.j2ee.callback.post-validate-war.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
-
+
<!-- ================================================================== -->
<!-- E A R -->
<!-- ================================================================== -->
-
+
<!-- produce an ear file -->
- <target name="ear" depends="local-init, ear-init, ear-error, war,
+ <target name="ear" depends="local-init, ear-init, ear-error, war,
pre-ear-callback, ear-build, post-ear-callback"
description="o Create an ear file" />
@@ -335,10 +335,10 @@
+------------------------------------------------------------------------------
</fail>
</target>
-
+
<!-- process any user specified pre ear callback -->
<target name="pre-ear-callback" if="maven.j2ee.callback.pre-ear.ok">
- <maven-ant antfile="${maven.j2ee.callback.pre-ear.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.pre-ear.buildFile}"
target="${maven.j2ee.callback.pre-ear.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
@@ -346,7 +346,7 @@
<!-- run the ear task -->
<target name="ear-build">
<echo>Building EAR ${maven.j2ee.ear.name}</echo>
-
+
<ear earfile="${maven.build.dir}/${maven.j2ee.ear.name}.ear"
appxml="${maven.j2ee.ear.appxml}">
<fileset dir="${maven.build.dir}" includes="${maven.j2ee.ear.includes}"
@@ -358,24 +358,24 @@
<attribute name="Built-By" value="${user.name}" />
<section name="${maven.package}">
<attribute name="Specification-Title" value="${maven.id}" />
- <attribute name="Specification-Version"
+ <attribute name="Specification-Version"
value="${maven.currentVersion}" />
- <attribute name="Specification-Vendor"
+ <attribute name="Specification-Vendor"
value="${maven.organization}" />
- <attribute name="Implementation-Title"
+ <attribute name="Implementation-Title"
value="${maven.package}" />
- <attribute name="Implementation-Version"
+ <attribute name="Implementation-Version"
value="${maven.currentVersion}" />
- <attribute name="Implementation-Vendor"
+ <attribute name="Implementation-Vendor"
value="${maven.organization}" />
</section>
</manifest>
</ear>
</target>
-
+
<!-- process any user specified post ear callback -->
<target name="post-ear-callback" if="maven.j2ee.callback.post-ear.ok">
- <maven-ant antfile="${maven.j2ee.callback.post-ear.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.post-ear.buildFile}"
target="${maven.j2ee.callback.post-ear.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
@@ -383,12 +383,12 @@
<!-- ================================================================== -->
<!-- E J B -->
<!-- ================================================================== -->
-
+
<!-- produce an ejb jar -->
<target name="ejb" depends="local-init, ejb-init, ejb-error, pre-ejb-callback,
ejb-build, post-ejb-callback"
description="Create an ejb file" />
-
+
<!-- check to make sure required files and properties are available -->
<target name="ejb-init">
<condition property="maven.j2ee.ejb.ready">
@@ -400,8 +400,8 @@
<available file="${maven.j2ee.ejb.conf.dir}" type="dir"/>
</and>
</condition>
-
- <property name="maven.j2ee.ejb.target-base"
+
+ <property name="maven.j2ee.ejb.target-base"
value="${maven.build.dir}/ejb/"/>
</target>
@@ -422,10 +422,10 @@
+------------------------------------------------------------------------------
</fail>
</target>
-
+
<!-- process any user defined pre ejb jar callback -->
<target name="pre-ejb-callback" if="maven.j2ee.callback.pre-ejb.ok">
- <maven-ant antfile="${maven.j2ee.callback.pre-ejb.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.pre-ejb.buildFile}"
target="${maven.j2ee.callback.pre-ejb.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
@@ -435,13 +435,13 @@
<!-- produce an ejb jar file by running the jar task -->
<target name="ejb-jar">
-
+
<!-- ejb jar is always built -->
<echo>Building EJB jar for ${maven.j2ee.ejb.name}</echo>
-
+
<mkdir dir="${maven.j2ee.ejb.target-base}"/>
- <jar jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}.jar"
+ <jar jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}.jar"
index="true">
<fileset dir="${maven.build.dir}/classes"
includes="${maven.j2ee.ejb.includes}"
@@ -451,24 +451,24 @@
<include name="LICENSE.txt"/>
</metainf>
- <metainf dir="${maven.j2ee.ejb.conf.dir}"
+ <metainf dir="${maven.j2ee.ejb.conf.dir}"
includes="${maven.j2ee.ejb.conf.includes}"
excludes="${maven.j2ee.ejb.conf.includes}">
</metainf>
-
+
<manifest>
<attribute name="Built-By" value="${user.name}" />
<section name="${maven.package}">
<attribute name="Specification-Title" value="${maven.id}" />
<attribute name="Specification-Version"
value="${maven.currentVersion}" />
- <attribute name="Specification-Vendor"
+ <attribute name="Specification-Vendor"
value="${maven.organization}" />
- <attribute name="Implementation-Title"
+ <attribute name="Implementation-Title"
value="${maven.package}" />
- <attribute name="Implementation-Version"
+ <attribute name="Implementation-Version"
value="${maven.currentVersion}" />
- <attribute name="Implementation-Vendor"
+ <attribute name="Implementation-Vendor"
value="${maven.organization}" />
</section>
</manifest>
@@ -477,15 +477,15 @@
<!-- produce an ejb jar with local interfaces -->
<target name="ejb-local" if="maven.j2ee.ejb.local.includes">
-
+
<echo>Building EJB local interface jar for ${maven.j2ee.ejb.name}</echo>
-
+
<!-- in case excludes hasn't been set -->
<property name="maven.j2ee.ejb.local.excludes" value=""/>
<mkdir dir="${maven.j2ee.ejb.target-base}"/>
- <jar jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}-local.jar"
+ <jar jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}-local.jar"
index="true">
<fileset dir="${maven.build.dir}/classes"
includes="${maven.j2ee.ejb.local.includes}"
@@ -494,7 +494,7 @@
<metainf dir="${basedir}">
<include name="LICENSE.txt"/>
</metainf>
-
+
<manifest>
<attribute name="Built-By" value="${user.name}" />
@@ -502,13 +502,13 @@
<attribute name="Specification-Title" value="${maven.id}" />
<attribute name="Specification-Version"
value="${maven.currentVersion}" />
- <attribute name="Specification-Vendor"
+ <attribute name="Specification-Vendor"
value="${maven.organization}" />
- <attribute name="Implementation-Title"
+ <attribute name="Implementation-Title"
value="${maven.package}" />
- <attribute name="Implementation-Version"
+ <attribute name="Implementation-Version"
value="${maven.currentVersion}" />
- <attribute name="Implementation-Vendor"
+ <attribute name="Implementation-Vendor"
value="${maven.organization}" />
</section>
</manifest>
@@ -517,16 +517,16 @@
<!-- produce an ejb jar with remote references -->
<target name="ejb-remote" if="maven.j2ee.ejb.remote.includes">
-
+
<!-- ejb jar is always built -->
<echo>Building EJB remote interface jar for ${maven.j2ee.ejb.name}</echo>
-
+
<!-- in case excludes hasn't been set -->
<property name="maven.j2ee.ejb.remote.excludes" value=""/>
<mkdir dir="${maven.j2ee.ejb.target-base}"/>
- <jar jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}-remote.jar"
+ <jar jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}-remote.jar"
index="true">
<fileset dir="${maven.build.dir}/classes"
includes="${maven.j2ee.ejb.remote.includes}"
@@ -535,20 +535,20 @@
<metainf dir="${basedir}">
<include name="LICENSE.txt"/>
</metainf>
-
+
<manifest>
<attribute name="Built-By" value="${user.name}" />
<section name="${maven.package}">
<attribute name="Specification-Title" value="${maven.id}" />
- <attribute name="Specification-Version"
+ <attribute name="Specification-Version"
value="${maven.currentVersion}" />
- <attribute name="Specification-Vendor"
+ <attribute name="Specification-Vendor"
value="${maven.organization}" />
- <attribute name="Implementation-Title"
+ <attribute name="Implementation-Title"
value="${maven.package}" />
- <attribute name="Implementation-Version"
+ <attribute name="Implementation-Version"
value="${maven.currentVersion}" />
- <attribute name="Implementation-Vendor"
+ <attribute name="Implementation-Vendor"
value="${maven.organization}" />
</section>
</manifest>
@@ -557,9 +557,273 @@
<!-- process any user defined post ejb jar callback -->
<target name="post-ejb-callback" if="maven.j2ee.callback.post-ejb.ok">
- <maven-ant antfile="${maven.j2ee.callback.post-ejb.buildFile}"
+ <maven-ant antfile="${maven.j2ee.callback.post-ejb.buildFile}"
target="${maven.j2ee.callback.post-ejb.buildTarget}"
inheritRefs="true" exportAll="false" exportRefs="false"/>
</target>
-
+
+
+ <!-- ================================================================== -->
+ <!-- A P P S E R V E R M A I N T A R G E T S -->
+ <!-- ================================================================== -->
+ <!-- set a property indicating if the server is installed -->
+ <target name="check-appserver-installed">
+ <available property="maven.appserver.installed"
+ file="${maven.appserver.dir}"
+ type="dir" />
+ </target>
+
+ <!-- set a property indicating if the appserver is started -->
+ <target name="check-appserver-started">
+ <fail unless="maven.appserver.url">
+ Cannot check the status of your appserver.
+
+ Please provide a URL using a property named maven.appserver.name
+ that will return an http code less than 400 when your instance
+ is started.
+ </fail>
+ <!-- Ant 1.5 alert!! http condition FIXME -->
+ <condition property="maven.appserver.started">
+ <http url="${maven.appserver.url}"/>
+ </condition>
+ </target>
+
+ <!--==================================================================-->
+ <!-- check and confirm proper appserver propeties -->
+ <!--==================================================================-->
+ <target name="check-appserver-properties">
+ <property name="maven.appserver.properties.ok" value="true" />
+ </target>
+ <target name="confirm-appserver-properties"
+ depends="check-appserver-properties"
+ unless="maven.appserver.properties.ok">
+ <fail>
+ Please correct the appserver properties:
+ </fail>
+ </target>
+ <target name="appserver-init"
+ depends="confirm-appserver-properties,
+ check-appserver-installed,
+ check-appserver-started" />
+
+ <!--==================================================================-->
+ <!-- I N S T A L L -->
+ <!--
+ Install Rules:
+ 1. if appserver is installed and stopped , reinstall over what is there
+ 2. if appserver is installed and started , stop-reinstall-restart
+ 3. always overwrite install files from last install in case the user
+ changed property values. ( see the appserver's specific install target )
+ -->
+ <!--==================================================================-->
+ <target name="appserver-install"
+ depends="local-init,
+ appserver-init,
+ appserver-install-notify,
+ appserver-install-proxy">
+ </target>
+
+ <target name="appserver-install-notify">
+ <property name="appserver-install.called" value="true" />
+ </target>
+
+ <target name="appserver-install-proxy"
+ depends="warn-appserver-reinstall-restarted,
+ warn-appserver-reinstall,
+ warn-appserver-restarted,
+ appserver-stop,
+ pre-appserver-install-callback,
+ appserver-install-build,
+ post-appserver-install-callback,
+ appserver-restart"/>
+
+ <target name="appserver-install-build">
+ <echo message="Installing ${maven.appserver.name} ${maven.appserver.version}" />
+ <echo message="to ${maven.appserver.dir}" />
+ <ant
antfile="${maven.home}/plugins/j2ee/conf/build-j2ee-${maven.j2ee.version}.xml"
+ target="install-${maven.appserver.name}-${maven.appserver.version}" />
+
+ <!-- copy the proxy file -->
+ <copy file="${maven.home}/plugins/$plugin/build-appserver-proxy.xml"
+ tofile="${maven.appserver.dir}/build.xml">
+ <filterset>
+ <filter token="basedir" value="${basedir}" />
+ </filterset>
+ </copy>
+ </target>
+
+ <!-- called from install target if when requested to install and the -->
+ <!-- appserver was already installed and started -->
+ <target name="appserver-restart"
+ if="appserver-install.called,maven.appserver.installed,
+ maven.appserver.started" unless="appserver-start.called">
+ <echo>Restarting ${maven.appserver.name}-${maven.appserver.version}
+ after reinstalling into ${maven.appserver.dir}</echo>
+ <antcall target="appserver-start-proxy"/>
+ </target>
+
+ <!--===================================================================-->
+ <!-- various user notification messages -->
+ <target name="warn-appserver-reinstall-restarted"
+ if="appserver-install.called,maven.appserver.installed,maven.appserver.started">
+ <echo message="Stoping, reinstalling and restarting appserver..." />
+ </target>
+
+ <target name="warn-appserver-reinstall"
+ if="appserver-install.called,maven.appserver.installed"
+ unless="maven.appserver.started">
+ <echo message="Reinstalling your appserver..." />
+ </target>
+
+ <target name="warn-appserver-restarted"
+ if="appserver-start.called">
+ <echo message="Restarting your appserver..." />
+ </target>
+
+ <!-- process any user specified appserver-install callbacks -->
+ <target name="pre-appserver-install-callback"
+ if="maven.appserver.callback.pre-appserver-install.ok">
+ <maven-ant antfile="${maven.appserver.callback.pre-appserver-install.buildFile}"
+ target="${maven.appserver.callback.pre-appserver-install.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
+ <target name="post-appserver-install-callback"
+ if="maven.appserver.callback.post-appserver-install.ok">
+ <maven-ant
antfile="${maven.appserver.callback.post-appserver-install.buildFile}"
+ target="${maven.appserver.callback.post-appserver-install.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
+ <!--==================================================================-->
+ <!-- S T A R T -->
+ <!--
+ Start Rules:
+ 1. if the appserver is not installed, install, then start
+ 2. if already installed and stopped, attempt to start
+ 3. if already installed and started, stop and then start again ( restart )
+ WITHOUT a reinstall - this is a quick way to reload webapps classes and
+ configuration if auto class reloading doesn't cut it
+ -->
+ <target name="appserver-start"
+ depends="local-init,
+ appserver-init,
+ appserver-start-notify,
+ appserver-install-proxy,
+ appserver-start-proxy" />
+
+ <target name="appserver-start-notify">
+ <property name="appserver-start.called" value="true" />
+ </target>
+
+ <target name="appserver-start-proxy"
+ depends="pre-appserver-start-callback,
+ appserver-start-build,
+ post-appserver-start-callback"/>
+
+ <target name="appserver-start-build">
+ <ant
antfile="${maven.home}/plugins/j2ee/conf/build-j2ee-${maven.j2ee.version}.xml"
+ target="start-${maven.appserver.name}-${maven.appserver.version}" />
+ </target>
+
+ <!-- process any user specified appserver-start callbacks -->
+ <target name="pre-appserver-start-callback"
+ if="maven.appserver.callback.pre-appserver-start.ok">
+ <maven-ant antfile="${maven.appserver.callback.pre-appserver-start.buildFile}"
+ target="${maven.appserver.callback.pre-appserver-start.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
+ <target name="post-appserver-start-callback"
+ if="maven.appserver.callback.post-appserver-start.ok">
+ <maven-ant antfile="${maven.appserver.callback.post-appserver-start.buildFile}"
+ target="${maven.appserver.callback.post-appserver-start.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
+ <!--==================================================================-->
+ <!-- S T O P -->
+ <!--
+ Stop Rules:
+ 1. if the appserver is started, stop it
+ -->
+ <!--==================================================================-->
+ <target name="appserver-stop"
+ depends="local-init,
+ appserver-init,
+ pre-appserver-stop-callback,
+ appserver-stop-build,
+ post-appserver-stop-callback"/>
+
+ <target name="appserver-stop-build"
+ depends="warn-appserver-stopped"
+ if="maven.appserver.started">
+ <echo>Stoping ${maven.appserver.name}-${maven.appserver.version}</echo>
+ <ant
antfile="${maven.home}/plugins/j2ee/conf/build-j2ee-${maven.j2ee.version}.xml"
+ target="stop-${maven.appserver.name}-${maven.appserver.version}" />
+ </target>
+
+ <!-- let the user know we think their appserver appears stopped -->
+ <target name="warn-appserver-stopped" unless="maven.appserver.started">
+ <echo message="Could not establish a http connection to" />
+ <echo message="" />
+ <echo message="${maven.appserver.url}" />
+ <echo message="" />
+ <echo message="Your ${maven.appserver.name} instance appears stopped." />
+ <echo message="Make sure the above URL is correct." />
+ </target>
+
+ <!-- process any user specified appserver-stop callbacks -->
+ <target name="pre-appserver-stop-callback"
+ if="maven.appserver.callback.pre-appserver-stop.ok">
+ <maven-ant antfile="${maven.appserver.callback.pre-appserver-stop.buildFile}"
+ target="${maven.appserver.callback.pre-appserver-stop.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
+ <target name="post-appserver-stop-callback"
+ if="maven.appserver.callback.post-appserver-stop.ok">
+ <maven-ant antfile="${maven.appserver.callback.post-appserver-stop.buildFile}"
+ target="${maven.appserver.callback.post-appserver-stop.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
+ <!--==================================================================-->
+ <!-- C L E A N -->
+ <!--
+ Clean Rules:
+ 1. if the server is running, stop it
+ 2. delete the entire install directory.
+ -->
+ <!--==================================================================-->
+ <target name="appserver-clean"
+ depends="local-init,
+ appserver-init,
+ appserver-stop,
+ pre-appserver-clean-callback,
+ appserver-clean-build,
+ post-appserver-clean-callback"/>
+
+ <target name="appserver-clean-build" >
+ <echo message="Deleting ${maven.appserver.name}-${maven.appserver.version}" />
+ <echo message="and all installed webapps from" />
+ <echo message="${maven.appserver.dir}..." />
+ <delete dir="${maven.appserver.dir}"/>
+ </target>
+
+ <!-- process any user specified appserver-clean callbacks -->
+ <target name="pre-appserver-clean-callback"
+ if="maven.appserver.callback.pre-appserver-clean.ok">
+ <maven-ant antfile="${maven.appserver.callback.pre-appserver-clean.buildFile}"
+ target="${maven.appserver.callback.pre-appserver-clean.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
+ <target name="post-appserver-clean-callback"
+ if="maven.appserver.callback.post-appserver-clean.ok">
+ <maven-ant antfile="${maven.appserver.callback.post-appserver-clean.buildFile}"
+ target="${maven.appserver.callback.post-appserver-clean.buildTarget}"
+ inheritRefs="true" exportAll="false" exportRefs="false"/>
+ </target>
+
</project>
1.6 +10 -2
jakarta-turbine-maven/src/templates/build/plugins/j2ee/Control.vm
Index: Control.vm
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/j2ee/Control.vm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Control.vm 3 Jun 2002 03:44:55 -0000 1.5
+++ Control.vm 14 Jun 2002 01:31:44 -0000 1.6
@@ -22,4 +22,12 @@
$delegators.put("war", "plugins/$plugin/build.xml")
$delegators.put("validate-war", "plugins/$plugin/build.xml")
$delegators.put("ejb", "plugins/$plugin/build.xml")
-$delegators.put("ear", "plugins/$plugin/build.xml")
\ No newline at end of file
+$delegators.put("ear", "plugins/$plugin/build.xml")
+
+## -------------------------------------------------------
+## Make the list of build-j2ee.xml delegators for appserver
+## -------------------------------------------------------
+$delegators.put("appserver-install", "plugins/$plugin/build.xml")
+$delegators.put("appserver-start", "plugins/$plugin/build.xml")
+$delegators.put("apserver-stop", "plugins/$plugin/build.xml")
+$delegators.put("appserver-clean", "plugins/$plugin/build.xml")
\ No newline at end of file
1.1
jakarta-turbine-maven/src/templates/build/plugins/j2ee/build-appserver-proxy.xml
Index: build-appserver-proxy.xml
===================================================================
<?xml version="1.0"?>
<project name="Maven Application Server Plugin Proxy" default="install"
basedir="@basedir@">
<!-- ================================================================== -->
<!-- Proxy for controlling an installed application server instance -->
<!-- ================================================================== -->
<!-- ========================================================== -->
<!-- Give user a chance to override without editing this file -->
<!-- (and without typing -D each time they compile) -->
<!-- ========================================================== -->
<!-- all ant projects specific properties -->
<property file="${user.home}/build.properties" />
<!-- project/user specific settings -->
<property file="@basedir@/build.properties" />
<!-- anything here is expected to be project defaults -->
<property file="@basedir@/project.properties" />
<!-- ========================================================== -->
<target name="install">
<ant antfile="${maven.home}/plugins/j2ee/build.xml"
target="appserver-install" />
</target>
<target name="start">
<ant antfile="${maven.home}/plugins/j2ee/build.xml"
target="appserver-start" />
</target>
<target name="stop">
<ant antfile="${maven.home}/plugins/j2ee/build.xml"
target="appserver-stop" />
</target>
</project>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>