Author: mstruk
Date: 2011-02-01 09:19:49 -0500 (Tue, 01 Feb 2011)
New Revision: 5832
Modified:
portal/trunk/packaging/jboss-as5/README.txt
portal/trunk/packaging/jboss-as5/pkg/pom.xml
Log:
GTNMAVEN-16 Packaging that supports JBossAS6 and does away with javascript packager
- Fixed WCI merged overwrites in jboss-as5
Modified: portal/trunk/packaging/jboss-as5/README.txt
===================================================================
--- portal/trunk/packaging/jboss-as5/README.txt 2011-02-01 13:20:11 UTC (rev 5831)
+++ portal/trunk/packaging/jboss-as5/README.txt 2011-02-01 14:19:49 UTC (rev 5832)
@@ -16,6 +16,7 @@
+
== Usage ==
@@ -25,14 +26,10 @@
Then go to packaging/jboss-as5 to perform packaging.
-There are three profiles that cover dependency download (-Pdownload), packaging as
exploded (-Ppack), and bundling as a zip (-Pbundle).
+There are three profiles that cover dependency download (-Pdownload), packaging as
exploded (default), and bundling as a zip (-Pbundle).
-For main build use either 'download' or 'pack' profile, but not both, as
'download' also includes 'pack' functionality.
-Both of these profiles also automatically perform 'clean' to assure consistent
results.
+For main build use either 'download' profile or no profile (default). Both of
these automatically perform 'clean' to ensure consistent results.
-Profile 'pack' is the one active by default. When activating any other profile,
the 'pack' profile is automatically turned off, so
- it may have to be explicitly activated again if packaging is required (i.e.
-Ppack,bundle).
-
There are two system properties that control where the root directory for JBoss AS
servers is located, and what specific JBoss AS directory to use.
They are preset to default location:
@@ -46,16 +43,17 @@
-== Examples ==
+== Some examples ==
+
1) The simplest form uses default location for JBoss AS
mvn
This is equivalent to:
-mvn clean package -Ppack -Dservers.dir=$GATEIN/portal/trunk/packaging/servers
-Djbossas.name=jboss-5.1.0.GA
+mvn clean package -Dservers.dir=$GATEIN/portal/trunk/packaging/servers
-Djbossas.name=jboss-5.1.0.GA
2) If JBoss AS is located somewhere else adjust servers.dir and jbossas.name accordingly
@@ -67,11 +65,11 @@
mvn -Pdownload
-If SERVERS_DIR is not at default location explicitly set it:
+If SERVERS_DIR is not at default location, explicitly set it:
mvn -Pdownload -Dservers.dir=SERVERS_DIR
-You shouldn't set jbossas.name property when using -Pdownload.
+There's no need to set 'jbossas.name' property when using -Pdownload (if set,
its value should be 'jboss-5.1.0.GA').
4) Zip bundle may be produced by activating 'bundle' profile
@@ -80,8 +78,72 @@
or
-mvn -Ppack,bundle
+mvn -Pbundle
-or just
-mvn -Pbundle
+
+
+
+== Compatibility with previous packaging (PKG) ==
+
+
+The previous packaging uses two different properties to specify 'servers.dir' and
'jbossas.name':
+
+ - exo.projects.directory.dependencies (equivalent to 'servers.dir')
+ - exo.projects.app.jboss5.version (equivalent to 'jbossas.name')
+
+
+Compatibility mode can be activated by using -Ppkg-jbossas5.
+
+
+
+
+
+== Build integration ==
+
+
+Packaging can be run separately from portal build as described before:
+
+# build portal first
+cd $GATEIN/portal/trunk
+mvn clean install -DskipTests
+
+# then package
+cd packaging/jboss-as5
+mvn
+
+
+Or it can be run together with the portal build, by using -Ppkg-jbossas5 compatibility
mode:
+
+# build and package all at once
+cd $GATEIN/portal/trunk
+mvn clean install -Ppkg-jbossas5,download -DskipTests
-Dexo.projects.directory.dependencies=$GATEIN/portal/trunk/packaging/servers
+
+(Notice how we also activate 'download' profile in this example - that's
ideal for a new user who's building GateIn for the first time)
+
+
+
+
+
+== Troubleshoot ==
+
+
+1) 'Checksum validation failed!'
+
+When using -Pdownload it may happen that the download is interrupted, and the resulting
file corrupt.
+The solution is to manually delete the target file from the filesystem, and run 'mvn
-Pdownload' again.
+
+2) 'DIRECTORY does not exist.' when using -Pdownload.
+
+When using -Pdownload, and specifying -Djbossas.name=NAME at the same time (something
you're adviced not to practice),
+the download part of the build will completely ignore 'jbossas.name' property,
but the packaging part will use it, and look for
+JBoss AS instance in the specified directory.
+The solution is to not specify -Djbossas.name=NAME at all, or to set its value to
'jboss-5.1.0.GA'.
+
+3) 'Destination JBossAS directory exists already: DIRECTORY'
+
+When using -Pdownload the downloaded JBoss AS distribution is unpacked into a local
directory. If the directory exists already
+the build will abort, to avoid corrupting a possibly carefully prepared specially
configured JBoss AS instance.
+One solution is to not use -Pdownload in this case since the appropriate JBoss AS is
already present. Or, you can move the
+directory out of the way, or delete it.
+
Modified: portal/trunk/packaging/jboss-as5/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as5/pkg/pom.xml 2011-02-01 13:20:11 UTC (rev 5831)
+++ portal/trunk/packaging/jboss-as5/pkg/pom.xml 2011-02-01 14:19:49 UTC (rev 5832)
@@ -17,11 +17,13 @@
<name>GateIn for JBoss AS 5.x.x packaging</name>
<properties>
+ <!-- The following two properties should not be changed! -->
<jbossas.version>5.1.0.GA</jbossas.version>
<jbossas.dist.version>5.1.0.GA-jdk6</jbossas.dist.version>
- <servers.dir>${exo.projects.directory.dependencies}</servers.dir>
+
+ <servers.dir>${project.basedir}/../../servers</servers.dir>
<jbossas.path>${servers.dir}</jbossas.path>
- <jbossas.name>${exo.projects.app.jboss5.version}</jbossas.name>
+ <jbossas.name>jboss-${jbossas.version}</jbossas.name>
<jbossas.dir>${jbossas.path}/${jbossas.name}</jbossas.dir>
<jbossas.target.dir>${project.build.directory}/jboss</jbossas.target.dir>
</properties>
@@ -909,112 +911,168 @@
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>check-jboss-environment-ready</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>jbossas.path</property>
+ <message>"
+You must define the property 'jbossas.path'
+to give the path to the directory where you store your applications servers.
+"
+ </message>
+ </requireProperty>
+ <requireProperty>
+ <property>jbossas.name</property>
+ <message>"
+You must define the property 'jbossas.name'
+to give the name of the directory where JBoss AS is stored.
+"
+ </message>
+ </requireProperty>
+ <requireFilesExist>
+ <files>
+ <file>${jbossas.path}/${jbossas.name}/</file>
+ </files>
+ <message>"
+The following JBoss AS directory doesn't exist :
+ ${jbossas.path}/${jbossas.name}
+Make JBoss AS instance available at that location, or use -Dservers.dir=PATH to point to
the correct location of servers directory
+and/or -Djbossas.name=NAME to point to the correct directory under the servers
directory.
+You can also use -Pdownload to automatically provide JBoss AS instance.
+"
+ </message>
+ </requireFilesExist>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </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>
+ <executions>
+ <execution>
+ <id>prepare-package</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <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>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
<profiles>
<profile>
- <id>download</id>
+ <id>pkg-jbossas5</id>
+
+ <properties>
+
<exo.projects.app.jboss5.version>jboss-5.1.0.GA</exo.projects.app.jboss5.version>
+
<servers.dir>${exo.projects.directory.dependencies}</servers.dir>
+ <jbossas.name>${exo.projects.app.jboss5.version}</jbossas.name>
+ </properties>
+
<build>
<plugins>
<plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.4.1</version>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
- <id>auto-clean</id>
- <phase>initialize</phase>
+
<id>check-jboss-legacy-environment-dependencies-dir</id>
<goals>
- <goal>clean</goal>
+ <goal>enforce</goal>
</goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+
<property>exo.projects.directory.dependencies</property>
+ <message>"
+You must define the property 'exo.projects.directory.dependencies'
+to specify the path to the directory where you store your application servers.
+"
+ </message>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
+ </configuration>
</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>
+ <id>check-jboss-legacy-environment-jboss-name</id>
<goals>
- <goal>run</goal>
+ <goal>enforce</goal>
</goals>
<configuration>
- <target>
- <property name="jbossas.zip"
value="${jbossas.path}/jboss-${jbossas.dist.version}.zip"/>
-
- <!-- Autocreate servers.dir if necessary -->
- <mkdir dir="${jbossas.path}"/>
-
- <!-- Download JBossAS unless already downloaded -->
- <ant
antfile="${project.basedir}/download-jboss.xml">
- <target name="download-jboss"/>
- <property name="url"
-
value="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-${jbo...
- <property name="dest"
value="${jbossas.zip}"/>
- </ant>
-
- <available property="jbossas.dir.exists"
type="dir" file="${jbossas.dir}"/>
-
- <fail message="Destination JBossAS directory exists
already: ${jbossas.dir} (Won't overwrite!)"
- if="jbossas.dir.exists"/>
-
- <!-- Extract downloaded JBossAS to servers dir -->
- <unzip src="${jbossas.zip}"
dest="${jbossas.path}" overwrite="false"/>
-
- <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>
+ <rules>
+ <requireProperty>
+
<property>exo.projects.app.jboss5.version</property>
+ <message>"
+You must define the property 'exo.projects.app.jboss5.version'
+to specify the name of the directory where JBoss AS is stored.
+"
+ </message>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
</configuration>
</execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>pack</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
<execution>
- <id>jboss-check-environment-ready</id>
+ <id>check-jboss-dir-exists</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
- <requireProperty>
- <property>jbossas.path</property>
- <message>"You must define the property
jbossas.path to give the path to the directory
- where you store your applications servers"
- </message>
- </requireProperty>
- <requireProperty>
- <property>jbossas.name</property>
- <message>"You must define the property
jbossas.name to give the name of the directory
- where JBoss AS is stored"
- </message>
- </requireProperty>
<requireFilesExist>
<files>
-
<file>${jbossas.path}/${jbossas.name}/</file>
+
<file>${exo.projects.directory.dependencies}/${exo.projects.app.jboss5.version}/
+ </file>
</files>
- <message>"The following JBoss AS directory
doesn't exist :
- ${jbossas.path}/${jbossas.name}
+ <message>"
+The following JBoss AS directory doesn't exist :
+
${exo.projects.directory.dependencies}/${exo.projects.app.jboss5.version}
-Make JBoss AS instance available at that location, or use -Dservers.dir=PATH to point to
the correct location.
+Make JBoss AS instance available at that location, or use
-Dexo.projects.directory.dependencies=PATH to point to the correct location
+of servers directory and/or -Dexo.projects.app.jboss5.version=NAME to point to the
correct directory under the servers directory.
You can also use -Pdownload to automatically provide JBoss AS instance.
"
</message>
@@ -1023,19 +1081,37 @@
<fail>true</fail>
</configuration>
</execution>
+ <execution>
+ <id>check-jboss-environment-ready</id>
+ <phase>none</phase>
+ </execution>
</executions>
</plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>download</id>
+ <build>
+ <plugins>
<plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.4.1</version>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
- <id>auto-clean</id>
- <phase>initialize</phase>
- <goals>
- <goal>clean</goal>
- </goals>
+ <id>check-jboss-environment-ready</id>
+ <phase>none</phase>
</execution>
+ <execution>
+ <id>check-jboss-legacy-environment-jboss-name</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>check-jboss-dir-exists</id>
+ <phase>none</phase>
+ </execution>
</executions>
</plugin>
<plugin>
@@ -1051,6 +1127,32 @@
</goals>
<configuration>
<target>
+ <available property="jbossas.dir.exists"
type="dir" file="${jbossas.dir}"/>
+
+ <fail if="jbossas.dir.exists">"
+Destination JBossAS directory exists already:
+ ${jbossas.dir}
+
+Either rename it, delete it, or deactivate -Pdownload profile.
+"
+ </fail>
+
+ <property name="jbossas.zip"
value="${jbossas.path}/jboss-${jbossas.dist.version}.zip"/>
+
+ <!-- Autocreate servers.dir if necessary -->
+ <mkdir dir="${jbossas.path}"/>
+
+ <!-- Download JBossAS unless already downloaded -->
+ <ant
antfile="${project.basedir}/download-jboss.xml">
+ <target name="download-jboss"/>
+ <property name="url"
+
value="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-${jbo...
+ <property name="dest"
value="${jbossas.zip}"/>
+ </ant>
+
+ <!-- Extract downloaded JBossAS to servers dir -->
+ <unzip src="${jbossas.zip}"
dest="${jbossas.path}" overwrite="false"/>
+
<ant antfile="${project.basedir}/package.xml"
inheritRefs="true">
<target name="package"/>
<property name="maven.project.basedir"
value="${project.basedir}"/>
@@ -1064,7 +1166,7 @@
</plugins>
</build>
</profile>
-
+
<profile>
<id>bundle</id>
<build>
@@ -1095,4 +1197,4 @@
</build>
</profile>
</profiles>
-</project>
\ No newline at end of file
+</project>