Introduced maven assembly plugin to produce the distribution package
This commit is contained in:
@@ -8,3 +8,4 @@ client/target/
|
||||
/parser_commons/target/netty_parser/target/
|
||||
netty_parser/target/
|
||||
parser_commons/target/
|
||||
/distribution/target/
|
||||
@@ -107,32 +107,6 @@
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>broker-distribution</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>org.dna.mqtt.moquette.server.Server</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<relativePath>../</relativePath>
|
||||
<!--<relativePath>../pom.xml</relativePath>-->
|
||||
<artifactId>moquette-parent</artifactId>
|
||||
<groupId>org.dna.mqtt</groupId>
|
||||
<version>0.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>distribution</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Moquette - distribution</name>
|
||||
|
||||
<!-- Includes all modules -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.dna.mqtt</groupId>
|
||||
<artifactId>moquette-broker</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dna.mqtt</groupId>
|
||||
<artifactId>moquette-parser-commons</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dna.mqtt</groupId>
|
||||
<artifactId>moquette-netty-parser</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${basedir}/src/main/</sourceDirectory> <!-- Force default maven layout -->
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>distribution-package</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- Specifies the configuration file of the assembly plugin -->
|
||||
<descriptors>
|
||||
<descriptor>${basedir}/src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
<tarLongFileMode>gnu</tarLongFileMode>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,31 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>bundle-tar</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
<!--<format>dir</format>-->
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory> <!-- disable the creation of root's distribution dir in the archive -->
|
||||
|
||||
<files>
|
||||
<!-- executables scripts-->
|
||||
<file>
|
||||
<source>src/main/scripts/moquette.sh</source>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
</file>
|
||||
|
||||
<file>
|
||||
<source>src/main/resources/README.txt</source>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>lib/</outputDirectory>
|
||||
<useProjectArtifact>true</useProjectArtifact> <!-- avoid inclusion of the artifact itself -->
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
@@ -0,0 +1 @@
|
||||
To run the Moquette distribution, untar the archive and run the script bin/moquette.sh
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2014 Andrea Selva
|
||||
#
|
||||
|
||||
echo "##########################################################"
|
||||
echo "# #"
|
||||
echo "# Launching Moquette-MQTT broker #"
|
||||
echo "# #"
|
||||
echo "##########################################################"
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# resolve links - $0 may be a softlink
|
||||
PRG="$0"
|
||||
|
||||
while [ -h "$PRG" ]; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
# Get standard environment variables
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
|
||||
# Only set MOQUETTE_HOME if not already set
|
||||
[ -f "$MOQUETTE_HOME"/bin/moquette.sh ] || MOQUETTE_HOME=`cd "$PRGDIR/.." ; pwd`
|
||||
export MOQUETTE_HOME
|
||||
|
||||
# Set JavaHome if it exists
|
||||
if [ -f "${JAVA_HOME}/bin/java" ]; then
|
||||
JAVA=${JAVA_HOME}/bin/java
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
export JAVA
|
||||
|
||||
#LOG_FILE=$ORIENTDB_HOME/config/moquette-server-log.properties
|
||||
#LOG_CONSOLE_LEVEL=info
|
||||
#LOG_FILE_LEVEL=fine
|
||||
#set MOQUETTE_SETTINGS="-Dprofiler.enabled=true -Dcache.level1.enabled=false -Dcache.level2.enabled=false"
|
||||
JAVA_OPTS_SCRIPT="-XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true"
|
||||
|
||||
#$JAVA -server $JAVA_OPTS $JAVA_OPTS_SCRIPT $ORIENTDB_SETTINGS -Dfile.encoding=UTF8 -Djava.util.logging.config.file="$LOG_FILE" -Dmoquette.config.file="$CONFIG_FILE" -Dmoquette.www.path="$WWW_PATH" -Dmoquette.build.number="@BUILD@" -cp "$ORIENTDB_HOME/lib/moquette-server-@[email protected]:$ORIENTDB_HOME/lib/*" com.orientechnologies.orient.server.OServerMain
|
||||
$JAVA -server $JAVA_OPTS $JAVA_OPTS_SCRIPT -cp "$MOQUETTE_HOME/lib/moquette-broker-0.5-SNAPSHOT.jar:$MOQUETTE_HOME/lib/*" org.dna.mqtt.moquette.server.Server
|
||||
|
||||
Reference in New Issue
Block a user