Skip to content

Commit

Permalink
Automatic build of dist
Browse files Browse the repository at this point in the history
  • Loading branch information
northlander committed Sep 5, 2017
1 parent ada9496 commit 5e053b1
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ a
A is a JMS testing/admin utility specialized for ActiveMQ.

Used to send, browse and put messages on queues.

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://travis-ci.org/fmtn/a.svg?branch=master)](https://travis-ci.org/fmtn/a)


Expand Down Expand Up @@ -183,7 +183,7 @@ This way, you can even connect to non ActiveMQ/AMQP brokers. You simply need to
2. create a file called "a" on your path (~/bin/a or what have you)
```
#!/bin/sh
java -jar ~/bin/a-1.4.0-jar-with-dependencies.jar "$@"
java -jar ~/bin/a-1.4.1-jar-with-dependencies.jar "$@"
```
3. chmod +x a
4. Run a from any place.
Expand All @@ -193,7 +193,7 @@ java -jar ~/bin/a-1.4.0-jar-with-dependencies.jar "$@"
2. create a file called "a.bat" on your path, i.e. c:\bin
```
@echo off
java -jar c:\bin\a-1.4.0-jar-with-dependencies.jar %*
java -jar c:\bin\a-1.4.1-jar-with-dependencies.jar %*
```
3. Run from any place.

Expand Down
45 changes: 34 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,28 +193,51 @@

</dependencies>
<build>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/assembly/bin</directory>
<filtering>true</filtering>
</resource>
</resources>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<mainClass>co.nordlander.a.A</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<mainClass>co.nordlander.a.A</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
<execution>
<id>dist</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
33 changes: 33 additions & 0 deletions src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<assembly>
<id>dist</id>
<!-- Specifies that our binary distribution is a zip package -->
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>

<baseDirectory>/</baseDirectory>

<files>
<file>
<source>target/${project.artifactId}-${project.version}-jar-with-dependencies.jar</source>
<outputDirectory>/</outputDirectory>
</file>
<file>
<source>README.md</source>
<outputDirectory>/</outputDirectory>
</file>
<file>
<source>LICENSE</source>
<outputDirectory>/</outputDirectory>
</file>
<file>
<source>target/classes/a</source>
<outputDirectory>/</outputDirectory>
</file>
<file>
<source>target/classes/a.bat</source>
<outputDirectory>/</outputDirectory>
</file>
</files>
</assembly>
2 changes: 2 additions & 0 deletions src/main/assembly/bin/a
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
java -jar ~/bin/${project.build.finalName}-jar-with-dependencies.jar "$@"%
2 changes: 2 additions & 0 deletions src/main/assembly/bin/a.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
java -jar c:\bin\${project.build.finalName}-jar-with-dependencies.jar %*

0 comments on commit 5e053b1

Please sign in to comment.