activemq/assembly/maven.xml

789 lines
28 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project default="default"
xmlns:j="jelly:core"
xmlns:u="jelly:util"
xmlns:ant="jelly:ant"
xmlns:util="jelly:util"
xmlns:artifact="artifact"
>
<!-- ================= -->
<!-- Global Properties -->
<!-- ================= -->
<!-- Determine what the top-level project root is -->
<j:set var="project.root" value="${pom.parentBasedir().getParentFile().getCanonicalFile()}"/>
<!-- ==================== -->
<!-- Default Global Goals -->
<!-- ==================== -->
<goal name="default">
<ant:copy todir="${basedir}/src/test/org/apache/activemq/usecases" file="${basedir}/src/release/conf/activemq.xml" overwrite="true"/>
<attainGoal name="dist:build-bin"/>
</goal>
<goal name="prepare"
prereqs="dist:prepare-bin-filesystem"/>
<postGoal name="clean">
<delete dir="${basedir}/activemq-data" />
</postGoal>
<preGoal name="jar:jar">
<ant:mkdir dir="${maven.build.dir}/timestamps"/>
<!-- Unpack all the composite ActiveMQ modules into the classes dir -->
<j:forEach var="artifact" items="${pom.artifacts}">
<j:set var="dependency" value="${artifact.dependency}"/>
<j:if test="${dependency.getProperty('activemq.module') == 'true'}">
<u:file var="file" name="${artifact.path}"/>
<j:if test="${file.exists()}" >
<j:set var="uptodateFile" value="${maven.build.dir}/timestamps/${artifact.name}.ts"/>
<j:set var="uptodatePropName" value="tests.uptodate"/>
<j:remove var="${uptodatePropName}"/>
<ant:uptodate property="${uptodatePropName}" targetfile="${uptodateFile}" srcfile="${artifact.path}"/>
<j:if test="${context.getVariable(uptodatePropName) != 'true'}">
<unjar dest="${maven.build.dir}/classes" src="${artifact.path}"/>
<ant:move todir="${maven.build.dir}/classes/META-INF/${artifact.name}">
<fileset dir="${maven.build.dir}/classes/META-INF">
<include name="MANIFEST.MF*"/>
<include name="COPYRIGHT*"/>
<include name="LICENSE*"/>
<include name="NOTICE*"/>
<include name="DISCLAIMER*"/>
</fileset>
</ant:move>
<touch file="${uptodateFile}"/>
</j:if>
</j:if>
</j:if>
</j:forEach>
</preGoal>
<goal name="rebuild">
<attainGoal name="clean"/>
<attainGoal name="default"/>
</goal>
<goal
name="dist:prepare-bin-filesystem"
prereqs="jar:install"
description="Builds the binary distribution file system.">
<!--
This is the directory where everything is copied to so that it can
be archived.
-->
<ant:delete dir="${maven.dist.bin.assembly.dir}"/>
<ant:mkdir dir="${maven.dist.bin.assembly.dir}"/>
<ant:mkdir dir="${maven.build.dir}/unjar"/>
<ant:echo>
+-------------------------------------------------------+
| C R E A T I N G B I N A R Y D I S T R I B U T I O N |
+-------------------------------------------------------+
</ant:echo>
<!-- Copy in distribution files -->
<ant:copy todir="${maven.dist.bin.assembly.dir}">
<ant:fileset dir="src/release"/>
</ant:copy>
<ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}/bin" eol="crlf" eof="doc" includes="*.bat"/>
<ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}/bin" eol="lf" eof="unix" includes="*" excludes="*.bat"/>
<ant:chmod perm="ugo+rx">
<ant:fileset dir="${maven.dist.bin.assembly.dir}/bin">
<ant:include name="activemq"/>
</ant:fileset>
</ant:chmod>
<ant:jar destfile="${maven.dist.bin.assembly.dir}/bin/run.jar" basedir="${maven.build.dir}/classes">
<ant:include name="org/apache/activemq/console/Main*.class"/>
<ant:manifest>
<ant:attribute name="Main-Class" value="org.apache.activemq.console.Main"/>
</ant:manifest>
</ant:jar>
<ant:copy todir="${maven.dist.bin.assembly.dir/conf}">
<ant:fileset dir="${maven.build.dir}/classes" includes="**/activemq.dtd"/>
</ant:copy>
<!--
<ant:unjar src="${maven.repo.local}/${pom.groupId}/jars/activemq-core-${pom.currentVersion}.jar"
dest="${maven.build.dir}/unjar">
<ant:patternset>
<ant:include name="**/activemq.dtd"/>
</ant:patternset>
</ant:unjar>
<ant:copy todir="${maven.dist.bin.assembly.dir}/conf" flatten="true">
<ant:fileset dir="${maven.build.dir}/unjar" includes="**/activemq.dtd"/>
</ant:copy>
-->
<ant:copy todir="${maven.dist.bin.assembly.dir}" file="${maven.repo.local}/${pom.groupId}/jars/${pom.artifactId}-${pom.currentVersion}.jar"/>
<!-- Copy the runtime dependencies into lib and create a classpath for the server.jar file -->
<j:set var="libDir" value="${maven.dist.bin.assembly.dir}/lib"/>
<j:set var="optionalDir" value="${maven.dist.bin.assembly.dir}/lib/optional"/>
<ant:mkdir dir="${libDir}"/>
<ant:mkdir dir="${optionalDir}"/>
<j:forEach var="artifact" items="${pom.artifacts}">
<j:set var="dependency" value="${artifact.dependency}"/>
<j:if test="${dependency.getProperty('lib') == 'true'}">
<ant:copy todir="${libDir}" file="${artifact.path}"/>
<j:set var="classpath" value="${classpath} ../lib/${artifact.name}"/>
</j:if>
</j:forEach>
<j:forEach var="artifact" items="${pom.artifacts}">
<j:set var="dependency" value="${artifact.dependency}"/>
<echo>${artifact.path} ${dependency.getProperty('optional') == 'true'}</echo>
</j:forEach>
<j:forEach var="artifact" items="${pom.artifacts}">
<j:set var="dependency" value="${artifact.dependency}"/>
<echo>${artifact.path}</echo>
<j:if test="${dependency.getProperty('optional') == 'true'}">
<ant:copy todir="${optionalDir}" file="${artifact.path}"/>
<j:if test="${dependency.extension == 'jar'}">
<j:set var="classpath" value="${classpath} ../lib/optional/${artifact.name}"/>
</j:if>
<!--
<j:if test="${dependency.extension == 'rar'}">
<ant:unzip src="${artifact.path}" dest="${optionalDir}">
<ant:patternset>
<include name="${dependency.artifactId}*.jar"/>
</ant:patternset>
</ant:unzip>
</j:if>
-->
</j:if>
</j:forEach>
<ant:echo message="${project.root}"/>
<ant:copy todir="${maven.dist.bin.assembly.dir}">
<fileset dir="${project.root}" includes="STATUS"/>
</ant:copy>
<!-- Copy documentation -->
<u:file var="file" name="${project.root}/activemq-core/target/docs"/>
<j:if test="${file.exists()}">
<j:set var="docsDest" value="${project.root}/activemq-core/target/docs"/>
<ant:copy todir="${maven.dist.bin.assembly.dir}/docs">
<ant:fileset dir="${docsDest}">
<ant:include name="**"/>
</ant:fileset>
</ant:copy>
</j:if>
<!-- Copy example modules -->
<u:file var="file" name="${project.root}/activemq-web-console"/>
<j:if test="${file.exists()}">
<ant:copy todir="${maven.dist.bin.assembly.dir}/example/activemq-web-console">
<ant:fileset dir="${file}">
<ant:include name="**"/>
<ant:exclude name="target"/>
</ant:fileset>
</ant:copy>
</j:if>
<!-- Copy example modules -->
<u:file var="file" name="${project.root}/activemq-web-demo"/>
<j:if test="${file.exists()}">
<ant:copy todir="${maven.dist.bin.assembly.dir}/example/activemq-web-demo">
<ant:fileset dir="${file}">
<ant:include name="**"/>
<ant:exclude name="target"/>
</ant:fileset>
</ant:copy>
</j:if>
</goal>
<goal
name="dist:prepare-src-filesystem"
description="Builds the source distribution file system.">
<!-- S O U R C E D I S T R I B U T I O N -->
<ant:delete dir="${maven.dist.src.assembly.dir}" />
<ant:mkdir dir="${maven.dist.src.assembly.dir}" />
<ant:echo>
+-------------------------------------------------------+
| C R E A T I N G S O U R C E D I S T R I B U T I O N |
+-------------------------------------------------------+
</ant:echo>
<ant:copy todir="${maven.dist.src.assembly.dir}">
<ant:fileset dir="${project.root}">
<ant:exclude name="**/target/**"/>
<ant:exclude name="*/bin/**"/>
<ant:exclude name="**/CVS/**"/>
<ant:exclude name="**/.*/**"/>
<ant:exclude name="**/junit*.properties"/>
<ant:exclude name="**/*~"/>
<ant:exclude name="**/*.bak"/>
<ant:exclude name="**/activemq-data/**"/>
<ant:exclude name="activemq-core/foo/**"/>
<ant:exclude name="data/**"/>
</ant:fileset>
</ant:copy>
<ant:available property="maven.dist.build.xml.avail" file="${basedir}/build.xml"/>
<j:choose>
<j:when test="${maven.dist.build.xml.avail}">
<ant:copy todir="${maven.dist.src.assembly.dir}" file="${basedir}/build.xml"/>
</j:when>
<j:otherwise>
<j:if test="${sourcesPresent == 'true'}">
<attainGoal name="ant:generate-build"/>
<ant:move
file="${basedir}/build.xml"
tofile="${maven.dist.src.assembly.dir}/build.xml"/>
</j:if>
</j:otherwise>
</j:choose>
<!-- Copy Source -->
<util:available file="${maven.src.dir}">
<ant:copy todir="${maven.dist.src.assembly.dir}/src">
<ant:fileset dir="${maven.src.dir}" />
</ant:copy>
</util:available>
</goal>
<!-- ================================================================ -->
<!-- GOALS for running activemq components -->
<!-- ================================================================ -->
<!-- Sample programs -->
<goal name="server" prereqs="setclasspath"
description="Runs the ActiveMQ server">
<j:choose>
<j:when test="${empty(url)}">
<!-- run using XML deployment descriptor -->
<j:if test="${empty(config)}">
<j:set var="config" value="xbean:file:src/release/conf/activemq.xml"/>
</j:if>
<echo>Running an ActiveMQ server with $$config = ${config}</echo>
<java classname="org.apache.activemq.console.Main" fork="yes" maxmemory="512M">
<classpath refid="test.classpath"/>
<arg value="${config}"/>
<j:if test="${!empty(debug)}">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>
<jvmarg value="-Djava.compiler=NONE"/>
</j:if>
<j:if test="${empty(ignoreServer) || !empty(debug)}">
<jvmarg value="-server"/>
</j:if>
<sysproperty key="derby.system.home" value="target/derby"/>
<sysproperty key="derby.storage.fileSyncTransactionLog" value="true"/>
</java>
</j:when>
<j:otherwise>
<!-- run simple server using just a URL -->
<echo>Running an ActiveMQ server at $$url = ${url}</echo>
<java classname="org.apache.activemq.console.Main" fork="yes" maxmemory="512M">
<classpath refid="test.classpath"/>
<arg value="${url}"/>
<j:if test="${!empty(debug)}">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>
<jvmarg value="-Djava.compiler=NONE"/>
</j:if>
<j:if test="${empty(ignoreServer) || !empty(debug)}">
<jvmarg value="-server"/>
</j:if>
<sysproperty key="derby.system.home" value="target/derby"/>
<sysproperty key="derby.storage.fileSyncTransactionLog" value="true"/>
<sysproperty key="activemq.persistenceAdapterFactory" value="${activemq.persistenceAdapterFactory}"/>
</java>
</j:otherwise>
</j:choose>
</goal>
<goal name="profile:server" prereqs="setclasspath"
description="Profiles the ActiveMQ server with OptimizeIt">
<j:if test="${empty(OPTIT_HOME)}">
<j:set var="OPTIT_HOME" value="C:/java/OptimizeitSuite/OptimizeitSuite50"/>
</j:if>
<j:choose>
<j:when test="${empty(url)}">
<!-- run using XML deployment descriptor -->
<j:if test="${empty(config)}">
<j:set var="config" value="src/sample-conf/default.xml"/>
</j:if>
<echo>Profiling an ActiveMQ server with $$config = ${config}</echo>
<java classname="intuitive.audit.Audit" fork="yes" maxmemory="64M">
<classpath refid="test.classpath"/>
<classpath path="${OPTIT_HOME}/lib/optit.jar"/>
<jvmarg value="-classic"/>
<jvmarg value="-Xrunpri"/>
<jvmarg value="-Xbootclasspath/a:${OPTIT_HOME}/lib/oibcp.jar"/>
<jvmarg value="-Xnoclassgc"/>
<arg value="-pause"/>
<arg value="org.apache.activemq.console.Main"/>
<arg value="${config}"/>
</java>
</j:when>
<j:otherwise>
<!-- run simple server using just a URL -->
<echo>Profiling an ActiveMQ server at $$url = ${url}</echo>
<java classname="intuitive.audit.Audit" fork="yes" maxmemory="64M">
<classpath refid="test.classpath"/>
<classpath path="${OPTIT_HOME}/lib/optit.jar"/>
<jvmarg value="-classic"/>
<jvmarg value="-Xrunpri"/>
<jvmarg value="-Xbootclasspath/a:${OPTIT_HOME}/lib/oibcp.jar"/>
<jvmarg value="-Xnoclassgc"/>
<arg value="-pause"/>
<arg value="org.apache.activemq.console.Main"/>
<arg value="${url}"/>
<sysproperty key="derby.system.home" value="target/derby"/>
<sysproperty key="derby.storage.fileSyncTransactionLog" value="true"/>
<sysproperty key="activemq.persistenceAdapterFactory" value="${activemq.persistenceAdapterFactory}"/>
</java>
</j:otherwise>
</j:choose>
</goal>
<goal name="webserver" prereqs="setclasspath"
description="Runs the ActiveMQ server embedded inside a web server">
<!--
<j:set var="maven.test.skip" value="true"/>
<attainGoal name="war"/>
-->
<j:if test="${empty(url)}">
<j:set var="url" value="${maven.repo.local}/${pom.groupId}/wars/activemq-web-${pom.currentVersion}.war"/>
</j:if>
<echo>Running an ActiveMQ web server with webapp = ${url}</echo>
<java classname="org.apache.activemq.tool.WebServer" fork="yes">
<classpath refid="test.classpath"/>
<jvmarg value="-server"/>
<arg value="${url}"/>
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
</java>
</goal>
<goal name="consumer" prereqs="setclasspath"
description="Runs a simple consumer">
<j:if test="${empty(url)}">
<j:set var="url" value="tcp://localhost:61616"/>
</j:if>
<j:if test="${empty(topic)}">
<j:set var="topic" value="true"/>
</j:if>
<j:if test="${empty(subject)}">
<j:set var="subject" value="FOO.BAR"/>
</j:if>
<j:if test="${empty(durable)}">
<j:set var="durable" value="false"/>
</j:if>
<j:if test="${empty(max)}">
<j:set var="max" value="0"/>
</j:if>
<echo>Running consumer against server at $$url = ${url} for subject $$subject = ${subject}</echo>
<java classname="org.apache.activemq.tool.ConsumerTool" fork="yes" maxmemory="100M">
<classpath refid="test.classpath"/>
<jvmarg value="-server"/>
<arg value="${url}"/>
<arg value="${topic}"/>
<arg value="${subject}"/>
<arg value="${durable}"/>
<arg value="${max}"/>
</java>
</goal>
<goal name="producer" prereqs="setclasspath"
description="Runs a simple producer">
<j:if test="${empty(url)}">
<j:set var="url" value="tcp://localhost:61616"/>
</j:if>
<j:if test="${empty(topic)}">
<j:set var="topic" value="true"/>
</j:if>
<j:if test="${empty(subject)}">
<j:set var="subject" value="FOO.BAR"/>
</j:if>
<j:if test="${empty(durable)}">
<j:set var="durable" value="false"/>
</j:if>
<j:if test="${empty(messageCount)}">
<j:set var="messageCount" value="10"/>
</j:if>
<j:if test="${empty(messageSize)}">
<j:set var="messageSize" value="255"/>
</j:if>
<echo>Running producer against server at $$url = ${url} for subject $$subject = ${subject}</echo>
<java classname="org.apache.activemq.tool.ProducerTool" fork="yes" maxmemory="100M">
<classpath refid="test.classpath"/>
<jvmarg value="-server"/>
<arg value="${url}"/>
<arg value="${topic}"/>
<arg value="${subject}"/>
<arg value="${durable}"/>
<arg value="${messageCount}"/>
<arg value="${messageSize}"/>
</java>
</goal>
<!-- JNDI examples -->
<goal name="jndi:producer" prereqs="setclasspath"
description="Runs a simple producer using JNDI to find the ConnectionFactory and Destination">
<j:if test="${!empty(jndi)}">
<echo>Using JNDI properties ${jndi}</echo>
<copy tofile="target/test-classes/jndi.properties" file="${jndi}" overwrite="true"/>
</j:if>
<j:if test="${empty(subject)}">
<j:set var="subject" value="MyQueue"/>
</j:if>
<j:if test="${empty(messageCount)}">
<j:set var="messageCount" value="10"/>
</j:if>
<echo>Running producer using subject $$subject = ${subject}</echo>
<java classname="org.apache.activemq.demo.SimpleProducer" fork="yes">
<classpath refid="test.classpath"/>
<jvmarg value="-server"/>
<arg value="${subject}"/>
<arg value="${messageCount}"/>
</java>
</goal>
<goal name="jndi:consumer" prereqs="setclasspath"
description="Runs a simple consumer using JNDI to find the ConnectionFactory and Destination">
<j:if test="${!empty(jndi)}">
<echo>Using JNDI properties ${jndi}</echo>
<copy tofile="target/test-classes/jndi.properties" file="${jndi}" overwrite="true"/>
</j:if>
<j:if test="${empty(subject)}">
<j:set var="subject" value="MyQueue"/>
</j:if>
<echo>Running consumer using subject $$subject = ${subject}</echo>
<java classname="org.apache.activemq.demo.SimpleConsumer" fork="yes">
<classpath refid="test.classpath"/>
<jvmarg value="-server"/>
<arg value="${subject}"/>
</java>
</goal>
<!-- benchmark tools -->
<goal name="bench:consumer" prereqs="setclasspath"
description="Runs a benchmark consumer">
<j:if test="${empty(topic)}">
<j:set var="topic" value="true"/>
</j:if>
<j:if test="${empty(url)}">
<j:set var="url" value="tcp://localhost:61616"/>
</j:if>
<j:if test="${empty(subject)}">
<j:set var="subject" value="FOO.BAR"/>
</j:if>
<j:if test="${empty(durable)}">
<j:set var="durable" value="false"/>
</j:if>
<j:if test="${empty(connections)}">
<j:set var="connections" value="1"/>
</j:if>
<echo>Running topic consumer against server at $$url = ${url} for subject $$subject = ${subject} with $$topic = ${topic}</echo>
<java classname="org.apache.activemq.benchmark.Consumer" fork="yes" maxmemory="100M">
<classpath refid="test.classpath"/>
<j:if test="${empty(ignoreServer)}">
<jvmarg value="-server"/>
</j:if>
<arg value="${url}"/>
<arg value="${topic}"/>
<arg value="${subject}"/>
<arg value="${durable}"/>
<arg value="${connections}"/>
</java>
</goal>
<goal name="bench:producer" prereqs="setclasspath"
description="Runs a benchmark producer">
<j:if test="${empty(topic)}">
<j:set var="topic" value="true"/>
</j:if>
<j:if test="${empty(url)}">
<j:set var="url" value="tcp://localhost:61616"/>
</j:if>
<j:if test="${empty(subject)}">
<j:set var="subject" value="FOO.BAR"/>
</j:if>
<j:if test="${empty(durable)}">
<j:set var="durable" value="false"/>
</j:if>
<j:if test="${empty(messageSize)}">
<j:set var="messageSize" value="1000"/>
</j:if>
<j:if test="${empty(connections)}">
<j:set var="connections" value="1"/>
</j:if>
<echo>Running topic producer against server at $$url = ${url} for subject $$subject = ${subject} with $$topic = ${topic} $$messageSize = ${messageSize}</echo>
<java classname="org.apache.activemq.benchmark.Producer" fork="yes">
<classpath refid="test.classpath"/>
<j:if test="${empty(ignoreServer)}">
<jvmarg value="-server"/>
</j:if>
<arg value="${url}"/>
<arg value="${topic}"/>
<arg value="${subject}"/>
<arg value="${durable}"/>
<arg value="${messageSize}"/>
<arg value="${connections}"/>
</java>
</goal>
<goal name="bench:both" prereqs="setclasspath"
description="Runs a benchmark producer and consumer inside the same JVM">
<j:if test="${empty(topic)}">
<j:set var="topic" value="true"/>
</j:if>
<j:if test="${empty(url)}">
<j:set var="url" value="tcp://localhost:61616"/>
</j:if>
<j:if test="${empty(subject)}">
<j:set var="subject" value="FOO.BAR"/>
</j:if>
<j:if test="${empty(durable)}">
<j:set var="durable" value="false"/>
</j:if>
<j:if test="${empty(connections)}">
<j:set var="connections" value="1"/>
</j:if>
<echo>Running topic producer against server at $$url = ${url} for subject $$subject = ${subject} with $$topic = ${topic}</echo>
<java classname="org.apache.activemq.benchmark.ProducerConsumer" fork="yes" maxmemory="100M">
<classpath refid="test.classpath"/>
<j:if test="${empty(ignoreServer)}">
<jvmarg value="-server"/>
</j:if>
<arg value="${url}"/>
<arg value="${topic}"/>
<arg value="${subject}"/>
<arg value="${durable}"/>
<arg value="${connections}"/>
</java>
</goal>
<goal name="bench:activemq-journal" prereqs="setclasspath"
description="Runs a benchmark to test the performance of the ActiveMQ journal">
<j:if test="${empty(journalDirectory)}">
<j:set var="journalDirectory" value="journal-logs"/>
</j:if>
<j:if test="${empty(workerIncrement)}">
<j:set var="workerIncrement" value="10"/>
</j:if>
<j:if test="${empty(incrementDelay)}">
<j:set var="incrementDelay" value="10000"/>
</j:if>
<j:if test="${empty(verbose)}">
<j:set var="verbose" value="true"/>
</j:if>
<j:if test="${empty(recordSize)}">
<j:set var="recordSize" value="1024"/>
</j:if>
<j:if test="${empty(syncFrequency)}">
<j:set var="syncFrequency" value="12"/>
</j:if>
<j:if test="${empty(workerThinkTime)}">
<j:set var="workerThinkTime" value="100"/>
</j:if>
<j:if test="${empty(segmentCount)}">
<j:set var="segmentCount" value="4"/>
</j:if>
<j:if test="${empty(segmentSize)}">
<j:set var="segmentSize" value="16777216"/>
</j:if>
<j:if test="${empty(OPTIT_HOME)}">
<j:set var="OPTIT_HOME" value="C:/java/OptimizeitSuite/OptimizeitSuite50"/>
</j:if>
<echo>Running ActiveMQ Journal Benchmark</echo>
<j:set var="mainClass" value="org.apache.activemq.journal.impl.JournalPerfTool"/>
<j:if test="${profile=='true'}">
<j:set var="mainClass" value="intuitive.audit.Audit"/>
</j:if>
<java classname="${mainClass}" fork="yes">
<j:if test="${profile=='true'}">
<jvmarg value="-Xrunpri:dmp=1"/>
<jvmarg value="-Xbootclasspath/a:${OPTIT_HOME}/lib/oibcp.jar"/>
<jvmarg value="-Xnoclassgc"/>
<classpath path="${OPTIT_HOME}/lib/optit.jar"/>
<arg value="-pause"/>
<arg value="org.apache.activemq.journal.impl.JournalPerfTool"/>
</j:if>
<j:elseif test="${empty(ignoreServer)}">
<jvmarg value="-server"/>
</j:elseif>
<classpath refid="test.classpath"/>
<arg value="${journalDirectory}"/>
<arg value="${workerIncrement}"/>
<arg value="${incrementDelay}"/>
<arg value="${verbose}"/>
<arg value="${recordSize}"/>
<arg value="${syncFrequency}"/>
<arg value="${workerThinkTime}"/>
<arg value="${segmentCount}"/>
<arg value="${segmentSize}"/>
</java>
</goal>
<goal name="bench:howl-journal" prereqs="setclasspath"
description="Runs a benchmark to test the performance of the HOWL journal">
<j:if test="${empty(journalDirectory)}">
<j:set var="journalDirectory" value="journal-logs"/>
</j:if>
<j:if test="${empty(workerIncrement)}">
<j:set var="workerIncrement" value="10"/>
</j:if>
<j:if test="${empty(incrementDelay)}">
<j:set var="incrementDelay" value="10000"/>
</j:if>
<j:if test="${empty(verbose)}">
<j:set var="verbose" value="true"/>
</j:if>
<j:if test="${empty(recordSize)}">
<j:set var="recordSize" value="1024"/>
</j:if>
<j:if test="${empty(syncFrequency)}">
<j:set var="syncFrequency" value="12"/>
</j:if>
<j:if test="${empty(workerThinkTime)}">
<j:set var="workerThinkTime" value="100"/>
</j:if>
<j:if test="${empty(maxLogFiles)}">
<j:set var="maxLogFiles" value="4"/>
</j:if>
<j:if test="${empty(bufferSize)}">
<j:set var="bufferSize" value="64"/> <!-- in k -->
</j:if>
<j:if test="${empty(maxBlocksPerFile)}">
<j:set var="maxBlocksPerFile" value="256"/>
</j:if>
<j:if test="${empty(maxBuffers)}">
<j:set var="maxBuffers" value="1000"/>
</j:if>
<echo>Running HOWL Journal Benchmark</echo>
<java classname="org.apache.activemq.journal.howl.JournalPerfTool" fork="no" maxmemory="100M">
<classpath refid="test.classpath"/>
<j:if test="${empty(ignoreServer)}">
<jvmarg value="-server"/>
</j:if>
<arg value="${journalDirectory}"/>
<arg value="${workerIncrement}"/>
<arg value="${incrementDelay}"/>
<arg value="${verbose}"/>
<arg value="${recordSize}"/>
<arg value="${syncFrequency}"/>
<arg value="${workerThinkTime}"/>
<arg value="${maxLogFiles}"/>
<arg value="${bufferSize}"/>
<arg value="${maxBuffers}"/>
<arg value="${maxBlocksPerFile}"/>
</java>
</goal>
<goal name="derbyserver" prereqs="setclasspath"
description="Starts a Derby Network Server">
<echo>Running Derby Network Server</echo>
<java classname="org.apache.derby.drda.NetworkServerControl" fork="yes" maxmemory="100M">
<classpath refid="test.classpath"/>
<arg value="start"/>
</java>
</goal>
<goal name="test-create-temp-queues" prereqs="setclasspath, test:compile"
description="Tests the creation of lots of temporary queues">
<java classname="org.apache.activemq.usecases.CreateLotsOfTemporaryQueuesTest" fork="yes" maxmemory="10M">
<classpath refid="test.classpath"/>
<arg value="${count}"/>
</java>
</goal>
<goal name="setclasspath">
<path id="test.classpath">
<pathelement path="src/release/conf"/>
<pathelement path="${maven.build.dest}"/>
<pathelement path="target/classes"/>
<pathelement path="target/test-classes"/>
<path refid="maven.dependency.classpath"/>
<pathelement path="${derby.db2jcc.jar.path}"/>
<pathelement path="${derby.db2jcc_license_c.jar.path}"/>
</path>
<!-- make directories for log and data -->
<mkdir dir="../var"/>
<mkdir dir="target/derby"/>
</goal>
</project>