You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2003/04/08 16:39:53 UTC
cvs commit: maven/src/plugins-build/jboss/sample/src/application/META-INF application.xml
vmassol 2003/04/08 07:39:53
Added: src/plugins-build/jboss/sample/conf/development/jboss/conf
test-jboss-conf.properties
src/plugins-build/jboss project.xml .cvsignore plugin.jelly
plugin.properties
src/plugins-build/jboss/sample project.properties
project.xml .cvsignore maven.xml
src/plugins-build/jboss/sample/conf/production/application
test-application2.properties
src/plugins-build/jboss/sample/conf/production/jboss/conf
test-jboss-conf2.properties
src/plugins-build/jboss/sample/conf/production/jboss/deploy
test-jboss-deploy2-service.xml
src/plugins-build/jboss/xdocs goals.xml changes.xml
.cvsignore properties.xml navigation.xml
src/plugins-build/jboss/sample/conf/development/jboss/deploy
test-jboss-deploy-service.xml
src/plugins-build/jboss/sample/conf/development/application
test-application.properties
src/plugins-build/jboss/sample/src/application/META-INF
application.xml
Log:
First implementation of a JBoss plugin. The primary feature is to create a custom JBoss server configuration and to start/stop Jboss using that configuration. Check the goals and properties xdocs for details.
Revision Changes Path
1.1 maven/src/plugins-build/jboss/sample/conf/development/jboss/conf/test-jboss-conf.properties
Index: test-jboss-conf.properties
===================================================================
test file. To be verify that the jboss plugin will correctly copy it in
the generated JBoss server configuration.
1.1 maven/src/plugins-build/jboss/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>${basedir}/../project.xml</extend>
<pomVersion>3</pomVersion>
<id>maven-jboss-plugin</id>
<name>Maven JBoss Plug-in</name>
<currentVersion>1.0-SNAPSHOT</currentVersion>
<description>Plugin for JBoss.</description>
<shortDescription>JBoss plugin</shortDescription>
<url>http://maven.apache.org/reference/plugins/jboss/</url>
<siteDirectory>/www/maven.apache.org/reference/plugins/jboss/</siteDirectory>
<repository>
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven/src/plugins-build/jboss/</connection>
<url>http://cvs.apache.org/viewcvs/maven/src/plugins-build/jboss/</url>
</repository>
<versions>
<version>
<id>1.0</id>
<name>1.0</name>
<tag>HEAD</tag>
</version>
</versions>
<developers>
<developer>
<name>Vincent Massol</name>
<id>vmassol</id>
<email>vmassol@pivolis.com</email>
<organization>Pivolis</organization>
<roles>
<role>Java Developer</role>
</roles>
</developer>
</developers>
<contributors/>
<dependencies/>
</project>
1.1 maven/src/plugins-build/jboss/.cvsignore
Index: .cvsignore
===================================================================
target
maven.log
velocity.log
build.properties
.classpath
.project
1.1 maven/src/plugins-build/jboss/plugin.jelly
Index: plugin.jelly
===================================================================
<?xml version="1.0"?>
<!--
=============================================================================
JBoss plugin for Maven. Contains JBoss related goals useful for
packaging and deploying applications.
=============================================================================
-->
<project xmlns:j="jelly:core">
<!--
========================================================================
Default goal.
========================================================================
-->
<goal name="jboss"
description="Creates a specific JBoss server configuration"
prereqs="jboss:package"/>
<!--
========================================================================
Initializations.
========================================================================
-->
<goal name="jboss:init">
<!-- Check if the maven.jboss.home mandatory property is set -->
<j:set var="jbosshomeX" value="${maven.jboss.home}X"/>
<j:choose>
<j:when test="${jbosshomeX == 'X'}">
<fail>You need to set the maven.jboss.home property</fail>
</j:when>
<j:otherwise>
<echo>Using JBoss from ${maven.jboss.home} ...</echo>
</j:otherwise>
</j:choose>
<property name="maven.jboss.build.deploy.dir"
value="${maven.jboss.build.dir}/${maven.jboss.conf.name}/deploy"/>
<property name="maven.jboss.build.lib.dir"
value="${maven.jboss.build.dir}/${maven.jboss.conf.name}/lib"/>
<property name="maven.jboss.build.conf.dir"
value="${maven.jboss.build.dir}/${maven.jboss.conf.name}/conf"/>
</goal>
<!--
========================================================================
Creates a JBoss server configuration directory structure, packaging
the application EAR in it.
========================================================================
-->
<goal name="jboss:package"
description="Creates a specific JBoss server configuration"
prereqs="ear:ear,jboss:init">
<!-- Copy the EAR to install to the JBoss deploy dir. -->
<copy file="${maven.build.dir}/${maven.final.name}.ear"
todir="${maven.jboss.build.deploy.dir}"/>
<!-- 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}"
includes="${maven.jboss.default.lib.includes}"
excludes="${maven.jboss.default.lib.excludes}"/>
</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}"
includes="${maven.jboss.default.conf.includes}"
excludes="${maven.jboss.default.conf.excludes}"/>
</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}"
includes="${maven.jboss.default.deploy.includes}"
excludes="${maven.jboss.default.deploy.excludes}"/>
</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}">
<fileset dir="${maven.jboss.conf.dir}"/>
</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}">
<fileset dir="${maven.jboss.deploy.dir}"/>
</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>
</j:if>
<!-- 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}"/>
</zip>
</goal>
<!--
========================================================================
Start JBoss using our specific server configuration.
========================================================================
-->
<goal name="jboss:start" prereqs="jboss:init"
description="Starts JBoss with our specific server configuration">
<java classname="org.jboss.Main" fork="yes" dir="${maven.jboss.home}/bin">
<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="file:/${maven.jboss.build.dir}/${maven.jboss.conf.name}"/>
<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>
</goal>
<!--
========================================================================
Stop JBoss.
========================================================================
-->
<goal name="jboss:stop" prereqs="jboss:init"
description="Stops JBoss">
<java classname="org.jboss.Shutdown" fork="yes">
<arg value="localhost"/>
<classpath>
<pathelement location="${maven.jboss.home}/bin/shutdown.jar"/>
</classpath>
</java>
</goal>
</project>
1.1 maven/src/plugins-build/jboss/plugin.properties
Index: plugin.properties
===================================================================
# Location of JBoss home (i.e. where JBoss is installed on your local drive
# maven.jboss.home = C:/jboss-3.0.4
# (optional) Location of where the application-specific JBoss conf files are
# located
# maven.jboss.conf.dir = conf/jboss/conf
# (optional) Location of where the application-specific JBoss deploy files are
# located
# maven.jboss.deploy.dir = 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
# 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}
# Location where to get the JBoss jars from
maven.jboss.default.lib.dir = ${maven.jboss.home}/server/default/lib
# Jars to include/exclude during the copy from maven.jboss.lib.dir
# to our new server configuration
maven.jboss.default.lib.includes = **/*.jar
maven.jboss.default.lib.excludes =
# Location where to get the JBoss default conf files from
maven.jboss.default.conf.dir = ${maven.jboss.home}/server/default/conf
# Deploy files to include/exclude during the copy from maven.jboss.conf.dir
# to our new server configuration
maven.jboss.default.conf.includes = **/*
maven.jboss.default.conf.excludes =
# Location where to get the JBoss default deploy files from
maven.jboss.default.deploy.dir = ${maven.jboss.home}/server/default/deploy
# Deploy files to include/exclude during the copy from maven.jboss.deploy.dir
# to our new server configuration
maven.jboss.default.deploy.includes = **/*
maven.jboss.default.deploy.excludes =
1.1 maven/src/plugins-build/jboss/sample/project.properties
Index: project.properties
===================================================================
maven.jboss.conf.name = my
maven.jboss.appconf.dir = target/appconf
maven.jboss.conf.dir = target/jboss/conf
maven.jboss.deploy.dir = target/jboss/deploy
env.name = development
# Note: Needs to define maven.jboss.home.
# Ex: maven.jboss.home = C:/Apps/jboss-3.0.4
# The best place to define it is in a build.properties file
1.1 maven/src/plugins-build/jboss/sample/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<!-- the version of maven's project object model -->
<pomVersion>3</pomVersion>
<!-- a unique name for this project -->
<id>maven-jboss-sample</id>
<!-- a short but descriptive name for the project -->
<name>JBoss plugin Sample</name>
<!-- The version of the project under development, e.g.
1.1, 1.2, 2.0-dev -->
<currentVersion>1.0-SNAPSHOT</currentVersion>
<!-- details about the organization that 'owns' the project -->
<organization>
<name>Apache Software Foundation</name>
<url>http://jakarta.apache.org/</url>
</organization>
<!-- the year the project started -->
<inceptionYear>2002</inceptionYear>
<!-- the top level of java packages that this project defines
e.g. if your project contains the packages
com.mycompany.accounts.reports, com.mycompany.accounts.reports
and com.mycompany.accounts.utils, the package would be
'com.mycompany.accounts' -->
<package>org.apache.maven.jboss.sample</package>
<!-- a short description of what the project does -->
<shortDescription>A sample project using the Jboss plugin for Maven</shortDescription>
<!-- the project home page -->
<url>http://maven.apache.org/</url>
<!-- the version control repository and http url for online access
the connection element has the form:
scm:<system>:<system specific connection string> -->
<repository>
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven</connection>
<url>http://cvs.apache.org/viewcvs/maven/</url>
</repository>
<!-- any mailing lists for the project -->
<mailingLists/>
<!-- who the developers are for the project -->
<developers/>
<!-- jar files the project is dependent on -->
<dependencies/>
<!-- build information for the project -->
<build>
<sourceDirectory>src/java</sourceDirectory>
</build>
</project>
1.1 maven/src/plugins-build/jboss/sample/.cvsignore
Index: .cvsignore
===================================================================
target
maven.log
build.properties
1.1 maven/src/plugins-build/jboss/sample/maven.xml
Index: maven.xml
===================================================================
<!--
=============================================================================
Shows how to copy specific jboss config files when using the JBoss plugin.
=============================================================================
-->
<project>
<preGoal name="jboss:package">
<copy todir="target/appconf">
<fileset dir="conf/${env.name}/application"/>
</copy>
<copy todir="target/jboss/conf">
<fileset dir="conf/${env.name}/jboss/conf"/>
</copy>
<copy todir="target/jboss/deploy">
<fileset dir="conf/${env.name}/jboss/deploy"/>
</copy>
</preGoal>
</project>
1.1 maven/src/plugins-build/jboss/sample/conf/production/application/test-application2.properties
Index: test-application2.properties
===================================================================
test file. To be verify that the jboss plugin will correctly copy it in
the generated JBoss server configuration.
1.1 maven/src/plugins-build/jboss/sample/conf/production/jboss/conf/test-jboss-conf2.properties
Index: test-jboss-conf2.properties
===================================================================
test file. To be verify that the jboss plugin will correctly copy it in
the generated JBoss server configuration.
1.1 maven/src/plugins-build/jboss/sample/conf/production/jboss/deploy/test-jboss-deploy2-service.xml
Index: test-jboss-deploy2-service.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- test file. To be verify that the jboss plugin will correctly copy it in
the generated JBoss server configuration. -->
<!DOCTYPE server>
<server>
</server>
1.1 maven/src/plugins-build/jboss/xdocs/goals.xml
Index: goals.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<document>
<properties>
<title>Maven JBoss Plug-in Goals</title>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<goals>
<goal>
<name>jboss:package</name>
<description>
Creates a JBoss server configuration directory structure, packaging
the application EAR in it.
</description>
</goal>
<goal>
<name>jboss:start</name>
<description>
Starts JBoss using our specific server configuration.
</description>
</goal>
<goal>
<name>jboss:stop</name>
<description>
Stops JBoss.
</description>
</goal>
</goals>
</body>
</document>
1.1 maven/src/plugins-build/jboss/xdocs/changes.xml
Index: changes.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Changes</title>
<author email="vmassol@pivolis.com">Vincent Massol</author>
</properties>
<body>
<release version="1.0" date="in CVS">
<action dev="vmassol" type="add">
Plugin creation.
</action>
</release>
</body>
</document>
1.1 maven/src/plugins-build/jboss/xdocs/.cvsignore
Index: .cvsignore
===================================================================
stylesheets
1.1 maven/src/plugins-build/jboss/xdocs/properties.xml
Index: properties.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<document>
<properties>
<title>JBoss Properties</title>
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
<section name="JBoss Settings">
<table>
<tr>
<th>Property</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>maven.jboss.home</td>
<td>No</td>
<td>
<p>
Location of JBoss home (i.e. where JBoss is installed on your
local drive. Example: <code>c:/jboss-3.0.4</code>.
</p>
</td>
</tr>
<tr>
<td>maven.jboss.conf.dir</td>
<td>Yes</td>
<td>
<p>
Location of where the application-specific JBoss conf files are
located. Example: <code>conf/jboss/conf</code>.
</p>
</td>
</tr>
<tr>
<td>maven.jboss.deploy.dir</td>
<td>Yes</td>
<td>
<p>
Location of where the application-specific JBoss deploy files are
located. Example: <code>conf/jboss/deploy</code>.
</p>
</td>
</tr>
<tr>
<td>maven.jboss.appconf.dir</td>
<td>Yes</td>
<td>
<p>
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). Example:
<code>conf/application</code>.
</p>
</td>
</tr>
<tr>
<td>maven.jboss.conf.name</td>
<td>Yes</td>
<td>
<p>
Name of the specific JBoss server configuration we are creating.
Default value is <code>custom</code>.
</p>
</td>
</tr>
</table>
</section>
</body>
</document>
1.1 maven/src/plugins-build/jboss/xdocs/navigation.xml
Index: navigation.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Maven JBoss Plugin">
<title>Maven JBoss Plugin</title>
<body>
<links>
<item name="Maven" href="http://maven.apache.org/"/>
<item name="JBoss" href="http://jboss.org/"/>
</links>
<menu name="Overview">
<item name="Goals" href="/goals.html"/>
<item name="Properties" href="/properties.html"/>
</menu>
</body>
</project>
1.1 maven/src/plugins-build/jboss/sample/conf/development/jboss/deploy/test-jboss-deploy-service.xml
Index: test-jboss-deploy-service.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- test file. To be verify that the jboss plugin will correctly copy it in
the generated JBoss server configuration. -->
<!DOCTYPE server>
<server>
</server>
1.1 maven/src/plugins-build/jboss/sample/conf/development/application/test-application.properties
Index: test-application.properties
===================================================================
test file. To be verify that the jboss plugin will correctly copy it in
the generated JBoss server configuration.
1.1 maven/src/plugins-build/jboss/sample/src/application/META-INF/application.xml
Index: application.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application
PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN'
'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
<application>
<display-name>Sample</display-name>
</application>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org