<action dev="vmassol" type="add">

The plugin now supports JBoss 3.2.x by default. Support for
        JBoss 3.0.x is still available by setting the
        <code>maven.jboss.version=3.0</code> property.
      </action>
      <action dev="vmassol" type="add">
        Added default start/stop script that are packaged into the
        generated jboss zip. Custom scripts can also be provided by
        overriding the <code>maven.jboss.script.dir</code> property.
      </action>


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113527 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol
2003-06-21 10:55:22 +00:00
parent e95b6675bc
commit 526cd935db
10 changed files with 167 additions and 68 deletions

View File

@@ -47,13 +47,43 @@
<echo>Using JBoss from ${maven.jboss.home} ...</echo>
</j:otherwise>
</j:choose>
<ant:echo>Using JBoss version ${maven.jboss.version}</ant:echo>
<property name="maven.jboss.build.deploy.dir"
<ant:property name="maven.jboss.build.deploy.dir"
value="${maven.jboss.build.dir}/${maven.jboss.conf.name}/deploy"/>
<property name="maven.jboss.build.lib.dir"
<ant:property name="maven.jboss.build.lib.dir"
value="${maven.jboss.build.dir}/${maven.jboss.conf.name}/lib"/>
<property name="maven.jboss.build.conf.dir"
<ant:property name="maven.jboss.build.conf.dir"
value="${maven.jboss.build.dir}/${maven.jboss.conf.name}/conf"/>
<ant:property name="maven.jboss.build.bin.dir"
value="${maven.jboss.build.dir}/bin"/>
<!-- Define the URL that points to our custom jboss server configuration.
Construct a URL valid on any OS -->
<util:file var="jbossfile"
name="${maven.jboss.build.dir}/${maven.jboss.conf.name}"/>
<j:set var="jbossurl" value="${jbossfile.toURL()}"/>
<!-- Filters used in the default jboss scripts run/shutdown -->
<ant:filter token="maven.jboss.home" value="${maven.jboss.home}"/>
<ant:filter token="jboss.server.home.dir"
value="${maven.jboss.build.dir}/${maven.jboss.conf.name}"/>
<ant:filter token="jboss.server.home.url"
value="${jbossurl}"/>
<ant:filter token="maven.jboss.conf.name" value="${maven.jboss.conf.name}"/>
<ant:filter token="maven.jboss.version" value="${maven.jboss.version}"/>
<ant:filter token="maven.jboss.hostname" value="${maven.jboss.hostname}"/>
<j:choose>
<j:when test="${systemScope['os.name'].startsWith('Windows')}">
<j:set var="isWindows" value="true"/>
<ant:echo>The operating system is Windows</ant:echo>
</j:when>
<j:otherwise>
<ant:echo>The operating system is Unix</ant:echo>
</j:otherwise>
</j:choose>
</goal>
@@ -69,55 +99,77 @@
<!-- Copy the JBoss jars from an existing JBoss default server
configuration to our specific configuration -->
<copy todir="${maven.jboss.build.lib.dir}">
<fileset dir="${maven.jboss.default.lib.dir}"
<ant:copy todir="${maven.jboss.build.lib.dir}">
<ant:fileset dir="${maven.jboss.default.lib.dir}"
includes="${maven.jboss.default.lib.includes}"
excludes="${maven.jboss.default.lib.excludes}"/>
</copy>
</ant:copy>
<!-- Copy the JBoss default conf files from an existing JBoss
server configuration to our specific configuration -->
<copy todir="${maven.jboss.build.conf.dir}">
<fileset dir="${maven.jboss.default.conf.dir}"
<ant:copy todir="${maven.jboss.build.conf.dir}">
<ant:fileset dir="${maven.jboss.default.conf.dir}"
includes="${maven.jboss.default.conf.includes}"
excludes="${maven.jboss.default.conf.excludes}"/>
</copy>
</ant:copy>
<!-- Copy the JBoss default deploy files from an existing JBoss
server configuration to our specific configuration -->
<copy todir="${maven.jboss.build.deploy.dir}">
<fileset dir="${maven.jboss.default.deploy.dir}"
<ant:copy todir="${maven.jboss.build.deploy.dir}">
<ant:fileset dir="${maven.jboss.default.deploy.dir}"
includes="${maven.jboss.default.deploy.includes}"
excludes="${maven.jboss.default.deploy.excludes}"/>
</copy>
</ant:copy>
<!-- Copy the application-specific JBoss conf files to our
specific configuration (if any) -->
<j:set var="jbossconfX" value="${maven.jboss.conf.dir}X"/>
<j:if test="${jbossconfX != 'X'}">
<copy todir="${maven.jboss.build.conf.dir}" overwrite="true">
<fileset dir="${maven.jboss.conf.dir}"/>
</copy>
<ant:copy todir="${maven.jboss.build.conf.dir}" overwrite="true">
<ant:fileset dir="${maven.jboss.conf.dir}"/>
</ant:copy>
</j:if>
<!-- Copy the application-specific JBoss deploy files to our
specific configuration (if any) -->
<j:set var="jbossdeployX" value="${maven.jboss.deploy.dir}X"/>
<j:if test="${jbossdeployX != 'X'}">
<copy todir="${maven.jboss.build.deploy.dir}" overwrite="true">
<fileset dir="${maven.jboss.deploy.dir}"/>
</copy>
<ant:copy todir="${maven.jboss.build.deploy.dir}" overwrite="true">
<ant:fileset dir="${maven.jboss.deploy.dir}"/>
</ant:copy>
</j:if>
<!-- Copy the application-specific conf files to our
specific configuration (if any) -->
<j:set var="jbossappconfX" value="${maven.jboss.appconf.dir}X"/>
<j:if test="${jbossappconfX != 'X'}">
<copy todir="${maven.jboss.build.conf.dir}">
<fileset dir="${maven.jboss.appconf.dir}"/>
</copy>
<ant:copy todir="${maven.jboss.build.conf.dir}">
<ant:fileset dir="${maven.jboss.appconf.dir}"/>
</ant:copy>
</j:if>
<!-- Copy the jboss scripts to start/stop/etc -->
<j:choose>
<j:when test="${isWindows}">
<ant:copy todir="${maven.jboss.build.bin.dir}" filtering="on">
<ant:fileset dir="${maven.jboss.script.dir}">
<ant:exclude name="shutdown*"/>
</ant:fileset>
</ant:copy>
<ant:copy tofile="${maven.jboss.build.bin.dir}/shutdown.bat"
file="${maven.jboss.script.dir}/shutdown.${maven.jboss.version}.bat"
filtering="on"/>
</j:when>
<j:otherwise>
<ant:copy todir="${maven.jboss.build.bin.dir}" filtering="on">
<ant:exclude name="shutdown*"/>
</ant:copy>
<ant:copy tofile="${maven.jboss.build.bin.dir}/shutdown"
file="${maven.jboss.script.dir}/shutdown.${maven.jboss.version}"
filtering="on"/>
</j:otherwise>
</j:choose>
</goal>
<!--
@@ -136,7 +188,7 @@
<!-- TODO: Use getDependencyPath() once it supports artifacts other
than jars -->
<copy todir="${maven.jboss.build.deploy.dir}"
<ant:copy todir="${maven.jboss.build.deploy.dir}"
file="${maven.repo.local}/${dep.artifactDirectory}/${dep.type}s/${dep.artifact}"/>
</j:if>
</j:forEach>
@@ -152,13 +204,12 @@
description="Generate zipped JBoss configuration">
<!-- Generate the distributable -->
<zip destfile="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.zip">
<zipfileset dir="${maven.jboss.build.dir}/${maven.jboss.conf.name}"
prefix="${maven.jboss.conf.name}">
<exclude name="tmp/**"/>
<exclude name="log/**"/>
</zipfileset>
</zip>
<ant:zip destfile="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.zip">
<ant:zipfileset dir="${maven.jboss.build.dir}" prefix="${pom.artifactId}">
<ant:exclude name="tmp/**"/>
<ant:exclude name="log/**"/>
</ant:zipfileset>
</ant:zip>
</goal>
@@ -185,27 +236,19 @@
<goal name="jboss:start" prereqs="jboss:init"
description="Starts JBoss with our specific server configuration">
<!-- Construct a URL valid on any OS -->
<util:file var="jbossfile"
name="${maven.jboss.build.dir}/${maven.jboss.conf.name}"/>
<j:set var="jbossurl" value="${jbossfile.toURL()}"/>
<j:choose>
<java classname="org.jboss.Main" fork="yes" dir="${maven.jboss.home}/bin">
<j:when test="${isWindows}">
<ant:exec dir="${maven.jboss.build.bin.dir}" executable="cmd.exe">
<ant:arg line="/c run.bat"/>
</ant:exec>
</j:when>
<sysproperty key="program.name" file="${maven.jboss.home}/bin/run.bat"/>
<sysproperty key="jboss.server.home.dir"
file="${maven.jboss.build.dir}/${maven.jboss.conf.name}"/>
<sysproperty key="jboss.server.home.url" value="${jbossurl}"/>
<arg line="-c ${maven.jboss.conf.name}"/>
<classpath>
<pathelement location="${maven.jboss.home}/bin/run.jar"/>
<pathelement path="${java.home}/../lib/tools.jar"/>
</classpath>
</java>
<j:otherwise>
</j:otherwise>
</j:choose>
</goal>
<!--
@@ -216,14 +259,18 @@
<goal name="jboss:stop" prereqs="jboss:init"
description="Stops JBoss">
<java classname="org.jboss.Shutdown" fork="yes">
<arg value="${maven.jboss.hostname}"/>
<j:choose>
<classpath>
<pathelement location="${maven.jboss.home}/bin/shutdown.jar"/>
</classpath>
<j:when test="${isWindows}">
<ant:exec dir="${maven.jboss.build.bin.dir}" executable="cmd.exe">
<ant:arg line="/c shutdown.bat"/>
</ant:exec>
</j:when>
</java>
<j:otherwise>
</j:otherwise>
</j:choose>
</goal>

View File

@@ -3,22 +3,32 @@
# (optional) Location of where the application-specific JBoss conf files are
# located
# maven.jboss.conf.dir = conf/jboss/conf
# maven.jboss.conf.dir = src/conf/jboss/conf
# (optional) Location of where the application-specific JBoss deploy files are
# located
# maven.jboss.deploy.dir = conf/jboss/deploy
# maven.jboss.deploy.dir = src/conf/jboss/deploy
# (optional) Location of application configuration files. These files will
# be copied to the JBoss conf/ server configuration directory (and will thus
# be in the server classpath).
# maven.jboss.appconf.dir = conf/application
# maven.jboss.appconf.dir = src/conf/application
# Location of scripts to start/stop/etc the jboss container. A user who wants
# to provide his own script will override this property in his project
# project.properties/build.properties.
# Note: If you write your own script you have access to the following filters:
# @maven.jboss.home@
# @jboss.server.home.dir@
# @jboss.server.home.url@
# @maven.jboss.conf.name@
maven.jboss.script.dir = ${pom.getPluginContext('maven-jboss-plugin').getVariable('plugin.dir')}/plugin-resources
# Name of the specific JBoss server configuration we are creating
maven.jboss.conf.name = custom
# Location where the specific JBoss server configuration is created
maven.jboss.build.dir = ${maven.build.dir}
maven.jboss.build.dir = ${maven.build.dir}/${pom.artifactId}
# Location where to get the JBoss jars from
maven.jboss.default.lib.dir = ${maven.jboss.home}/server/default/lib
@@ -48,6 +58,9 @@ maven.jboss.default.deploy.excludes =
# Note: This is used to shut JBoss down.
maven.jboss.hostname = localhost
# JBoss version
maven.jboss.version=3.2
# ---------------------------------------------------------------------------
# Note: The properties listed below are only needed for the deploy/undeploy
# goals

View File

@@ -3,6 +3,5 @@
# Default JBoss start up shell script. It calls the default script found
# in JBOSS_HOME/bin.
# ----------------------------------------------------------------------------
JAVA_OPTS="-Djboss.server.home.dir=@jboss.server.home.dir@ -Djboss.server.home.url=@jboss.server.home.url@"
@maven.jboss.home@/bin/run -c @maven.jboss.conf.name@

View File

@@ -2,6 +2,5 @@
@REM Default JBoss start up batch script. It calls the default script found
@REM in JBOSS_HOME/bin.
@REM ----------------------------------------------------------------------------
@set JAVA_OPTS="-Djboss.server.home.dir=@jboss.server.home.dir@" "-Djboss.server.home.url=@jboss.server.home.url@"
@call @maven.jboss.home@\bin\run.bat -c @maven.jboss.conf.name@

View File

@@ -3,5 +3,4 @@
# Default JBoss shutdown shell script. It calls the default script found
# in JBOSS_HOME/bin.
# ----------------------------------------------------------------------------
@maven.jboss.home@/bin/shutdown @maven.jboss.hostname@

View File

@@ -3,6 +3,5 @@ REM ----------------------------------------------------------------------------
REM Default JBoss shutdown batch script. It calls the default script found
REM in JBOSS_HOME/bin.
REM ----------------------------------------------------------------------------
call @maven.jboss.home@\bin\shutdown.bat @maven.jboss.hostname@

View File

@@ -3,5 +3,4 @@
# Default JBoss shutdown shell script. It calls the default script found
# in JBOSS_HOME/bin.
# ----------------------------------------------------------------------------
@maven.jboss.home@/bin/shutdown -S

View File

@@ -3,6 +3,4 @@ REM ----------------------------------------------------------------------------
REM Default JBoss shutdown batch script. It calls the default script found
REM in JBOSS_HOME/bin.
REM ----------------------------------------------------------------------------
call @maven.jboss.home@\bin\shutdown.bat -S

View File

@@ -8,6 +8,16 @@
<body>
<release version="1.2" date="in CVS">
<action dev="vmassol" type="add">
The plugin now supports JBoss 3.2.x by default. Support for
JBoss 3.0.x is still available by setting the
<code>maven.jboss.version=3.0</code> property.
</action>
<action dev="vmassol" type="add">
Added default start/stop script that are packaged into the
generated jboss zip. Custom scripts can also be provided by
overriding the <code>maven.jboss.script.dir</code> property.
</action>
<action dev="vmassol" type="fix">
When generating the JBoss server configuration zip, exclude
JBoss tmp and log directories from the zip.

View File

@@ -67,7 +67,7 @@
</tr>
<tr>
<td>maven.jboss.hostname</td>
<td>No</td>
<td>Yes</td>
<td>
<p>
Hostname on which JBoss is executing. Default value is
@@ -77,7 +77,7 @@
</tr>
<tr>
<td>maven.jboss.port</td>
<td>No</td>
<td>Yes</td>
<td>
<p>
Port on which JBoss' jmx-console is available. Default value is
@@ -87,7 +87,7 @@
</tr>
<tr>
<td>maven.jboss.jmx.url.deploy</td>
<td>No</td>
<td>Yes</td>
<td>
<p>
URL at which an http get will deploy a target. Default value is
@@ -97,7 +97,7 @@
</tr>
<tr>
<td>maven.jboss.jmx.url.undeploy</td>
<td>No</td>
<td>Yes</td>
<td>
<p>
URL at which an http get will undeploy a target. Default value is
@@ -105,6 +105,42 @@
</p>
</td>
</tr>
<tr>
<td>maven.jboss.script.dir</td>
<td>Yes</td>
<td>
<p>
Location of scripts to start/stop/etc the jboss container. A
user who wants to provide his own script will override this
property in his project <code>project.properties</code>/
<code>build.properties</code>.
</p>
<p>
If you write your own script you have access to the following
filters:
</p>
<ul>
<li><code>@maven.jboss.home@</code></li>
<li><code>@jboss.server.home.dir@</code></li>
<li><code>@jboss.server.home.url@</code></li>
<li><code>@maven.jboss.conf.name@</code></li>
<li><code>@maven.jboss.version@</code></li>
<li><code>@maven.jboss.hostname@</code></li>
</ul>
</td>
</tr>
<tr>
<td>maven.jboss.version</td>
<td>Yes</td>
<td>
<p>
The plugin now supports JBoss 3.2.x by default. Support for
JBoss 3.0.x is still available by setting the
<code>maven.jboss.version=3.0</code> property. This property
defaults to <code>3.2</code>.
</p>
</td>
</tr>
</table>
</section>
</body>