Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Maven plugin for building EmJar-enabled jar-in-jar bundles.
  • Loading branch information
Arne Georg Gleditsch committed May 21, 2014
commit 99978bd20405d854c7769ec2f16543bbd820cd25
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ The list of components currently reads as follows:
* [logging-context-json](logging-context-json) Context-aware JSON/logstash log formatter
* [pb-json](pb-json) Hassle-free conversion from Protobuf to JSON and back
* [emjar](emjar) Class loader and supporting cast for using jar-in-jar embedded archives as part of classpath
* [emjar-maven-plugin](emjar-maven-plugin) Generate EmJar-enabled bundle archives from Maven
82 changes: 82 additions & 0 deletions emjar-maven-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
emjar-maven-plugin
==================

Maven Plugin Mojo for building bundling jars that contain dependency artifact jars verbatim. The bundling jars are built to include the [EmJar](../emjar) class loader for allowing use of the embedded jars as parts of the classpath for the main application code.

### Available parameters

* finalName

Final name for generated Java Archive file.

* explicitOrderings

Set of explicit orderings for dependency artifacts that contain conflicting entries.

* mainJar

Jar file containing main application code.

* manifestEntries

Additional Manifest entries to include in top-level jar.

* outputDirectory

Output directory for generated jar file.

* ignoreConflicts

Ingore jar content conflicts.


### Minimal usage example

```xml
<plugins>
...
<plugin>
<groupId>com.comoyo.commons</groupId>
<artifactId>emjar-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
```

### With explicit ordering constraints

```xml
<plugins>
...
<plugin>
<groupId>com.comoyo.commons</groupId>
<artifactId>emjar-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-${git.commit.id.abbrev}</finalName>
<explicitOrderings>
<explicitOrdering>
<prefer>org.slf4j:log4j-over-slf4j</prefer>
<over>log4j:log4j</over>
</explicitOrdering>
</explicitOrderings>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
```
89 changes: 89 additions & 0 deletions emjar-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>commons</artifactId>
<groupId>com.comoyo</groupId>
<version>1.0-SNAPSHOT</version>
</parent>

<name>emjar-maven-plugin -- for building executable embedded jar files</name>
<groupId>com.comoyo.commons</groupId>
<artifactId>emjar-maven-plugin</artifactId>

<url>https://github.com/comoyo/commons/emjar-maven-plugin</url>
<packaging>maven-plugin</packaging>

<prerequisites>
<maven>3</maven>
</prerequisites>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${google.guava.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.0.5</version>
</dependency>

<dependency>
<groupId>com.comoyo.commons</groupId>
<artifactId>emjar</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
<configuration>
<goalPrefix>emjar</goalPrefix>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading