Commit 30faac40 authored by R.W.Majeed's avatar R.W.Majeed

Maven assembly to build binary distribution via 'mvn assembly:single'

parent 1114b79e
......@@ -32,14 +32,16 @@
<target>1.8</target>
</configuration>
</plugin>
<!-- assembly plugin to specify main class for runnable jar -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>de.sekmi.histream.impl.HIStream</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>de.sekmi.histream.impl.RunConfiguration</mainClass>
</manifest>
</archive>
</configuration>
......@@ -95,11 +97,9 @@
</configuration>
</execution>
</executions>
</plugin>-->
</plugin>
<plugin>
<!-- collect dependencies -->
<!-- use mvn dependency:copy-dependencies to execute -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
......@@ -110,14 +110,22 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- configure the plugin here -->
<!--<outputDirectory>
${project.build.directory}/dependencies
</outputDirectory>-->
</configuration>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<configuration>
<!-- Configures the used assembly descriptor -->
<descriptors>
<descriptor>src/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
......
<assembly>
<id>bin</id>
<!-- Specifies that our binary distribution is a zip package -->
<formats>
<format>zip</format>
</formats>
<!-- Adds the dependencies of our application to the lib directory -->
<dependencySets>
<dependencySet>
<!--
Project artifact is not copied under library directory since
it is added to the root directory of the zip package.
-->
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
<fileSets>
<!--
Adds startup scripts to the root directory of zip package. The startup
scripts are copied from the src/main/scripts directory.
-->
<fileSet>
<directory>${project.build.scriptSourceDirectory}/startup</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*</include>
</includes>
<filtered>true</filtered>
</fileSet>
<!--
Adds the jar file of our example application to the root directory
of the created zip package.
-->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
......@@ -142,10 +142,26 @@ public class RunConfiguration implements Closeable{
return;
}
// TODO check for file histream.xml
File xml = new File("histream.xml");
if( !xml.canRead() ){
System.err.println("Unable to find/read file histream.xml");
xml = new File("src/test/resources/histream.xml");
if( xml.canRead() )
System.err.println("Using src/test/resources/histream.xml");
else
xml = null;
}
if( xml == null ){
System.err.println("Unable to run without configuration");
System.exit(1);
}
System.out.println("HIStream "+readVersion()+" starting");
long millis = System.currentTimeMillis();
Configuration conf = Configuration.fromFile(new File("src/test/resources/histream.xml"));
Configuration conf = Configuration.fromFile(xml);
RunConfiguration rc = new RunConfiguration(conf);
// TODO set error handlers for destinations
......
@ECHO OFF
REM ${name}
SET mydir="%~dp0"
java -Djava.util.logging.config.file=logging.properties -jar ${project.build.finalName}.jar %*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment