Skip to content

Commit

Permalink
preparing for 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdchristo committed Nov 18, 2016
1 parent aba81ac commit 169d834
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Capsule Maven Plugin
====================

[![Version](http://img.shields.io/badge/version-1.4.0-blue.svg?style=flat)](https://github.com/chrisdchristo/capsule-maven-plugin/releases)
[![Maven Central](http://img.shields.io/badge/maven_central-1.4.0-blue.svg?style=flat)](http://mvnrepository.com/artifact/com.github.chrisdchristo/capsule-maven-plugin/)
[![Version](http://img.shields.io/badge/version-1.4.2-blue.svg?style=flat)](https://github.com/chrisdchristo/capsule-maven-plugin/releases)
[![Maven Central](http://img.shields.io/badge/maven_central-1.4.2-blue.svg?style=flat)](http://mvnrepository.com/artifact/com.github.chrisdchristo/capsule-maven-plugin/)
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT)

A maven plugin to build a [capsule](https://github.com/puniverse/capsule) out of your app.
Expand Down Expand Up @@ -727,6 +727,7 @@ Note that if you do specify the `<appClass>`, `<properties>` or `JVM-Args` (in t
* `<execPluginConfig> (Optional)`: Specifies the ID of an execution within the exec-maven-plugin. The configuration from this execution will then be used to configure the capsules. If you specify 'root' then the `<configuration>` at root will be used instead of a particular execution. The exec's `<mainClass>` will map to Capsule's `<appClass>`. The exec's `<systemProperties>` will map to capsule's `<properties>`. If you specify this tag then the `<appClass>` tag does not need to present.
* `<properties> (Optional)`: The system properties to provide the app with.
* `<type> (Optional)`: Can be either ```empty```, ```thin``` or ```fat```. Tells the plugin to build a capsule based on of these predefined builds. If present, the plugin will ignore all of the ```<includeXYZ>``` and ```<resolveXYZ>```.
* `<setManifestRepos> (Optional)`: Can either be ```true``` or ```false```, default is ```false```. This will append a manifest entry ```Repositories``` with values as defined by the project's ```pom.xml```.
* `<includeApp> (Optional)`: Specify whether the app itself should be embedded. Default is true. Also, this is ignored if ```<type>``` is present.
* `<includeCompileDep> (Optional)`: Specify whether compile scope dependencies should be embedded. Default is true. Also, this is ignored if ```<type>``` is present.
* `<includeRuntimeDep> (Optional)`: Specify whether runtime scope dependencies should be embedded. Default is true. Also, this is ignored if ```<type>``` is present.
Expand Down
62 changes: 32 additions & 30 deletions src/main/java/com/github/chrisdchristo/capsule/CapsuleMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,49 +87,51 @@ public class CapsuleMojo extends AbstractMojo {
private String caplets;
@Parameter(property = "capsule.type")
private Type type = null;
@Parameter(property = "capsule.chmod", defaultValue = "false")
private String chmod = null;
@Parameter(property = "capsule.trampoline", defaultValue = "false")
private String trampoline = null;

@Parameter(property = "capsule.includeApp", defaultValue = "true")
private boolean includeApp = false;
@Parameter(property = "capsule.includeTransitiveDep", defaultValue = "true")
private boolean includeTransitiveDep = false;
@Parameter(property = "capsule.includeCompileDep", defaultValue = "true")
private boolean includeCompileDep = false;
@Parameter(property = "capsule.includeRuntimeDep", defaultValue = "true")
private boolean includeRuntimeDep = false;
@Parameter(property = "capsule.includeProvidedDep", defaultValue = "false")
@Parameter(property = "capsule.chmod")
private boolean chmod = false;
@Parameter(property = "capsule.trampoline")
private boolean trampoline = false;
@Parameter(property = "capsule.setManifestRepos")
private boolean setManifestRepos = false;

@Parameter(property = "capsule.includeApp")
private boolean includeApp = true;
@Parameter(property = "capsule.includeTransitiveDep")
private boolean includeTransitiveDep = true;
@Parameter(property = "capsule.includeCompileDep")
private boolean includeCompileDep = true;
@Parameter(property = "capsule.includeRuntimeDep")
private boolean includeRuntimeDep = true;
@Parameter(property = "capsule.includeProvidedDep")
private boolean includeProvidedDep = false;
@Parameter(property = "capsule.includeSystemDep", defaultValue = "false")
@Parameter(property = "capsule.includeSystemDep")
private boolean includeSystemDep = false;
@Parameter(property = "capsule.includeTestDep", defaultValue = "false")
@Parameter(property = "capsule.includeTestDep")
private boolean includeTestDep = false;
@Parameter(property = "capsule.includeOptionalDep", defaultValue = "false")
@Parameter(property = "capsule.includeOptionalDep")
private boolean includeOptionalDep = false;

@Parameter(property = "capsule.resolveApp", defaultValue = "false")
@Parameter(property = "capsule.resolveApp")
private boolean resolveApp = false;
@Parameter(property = "capsule.resolveTransitiveDep", defaultValue = "false")
@Parameter(property = "capsule.resolveTransitiveDep")
private boolean resolveTransitiveDep = false;
@Parameter(property = "capsule.resolveCompileDep", defaultValue = "false")
@Parameter(property = "capsule.resolveCompileDep")
private boolean resolveCompileDep = false;
@Parameter(property = "capsule.resolveRuntimeDep", defaultValue = "false")
@Parameter(property = "capsule.resolveRuntimeDep")
private boolean resolveRuntimeDep = false;
@Parameter(property = "capsule.resolveProvidedDep", defaultValue = "false")
@Parameter(property = "capsule.resolveProvidedDep")
private boolean resolveProvidedDep = false;
@Parameter(property = "capsule.resolveSystemDep", defaultValue = "false")
@Parameter(property = "capsule.resolveSystemDep")
private boolean resolveSystemDep = false;
@Parameter(property = "capsule.resolveTestDep", defaultValue = "false")
@Parameter(property = "capsule.resolveTestDep")
private boolean resolveTestDep = false;
@Parameter(property = "capsule.resolveOptionalDep", defaultValue = "false")
@Parameter(property = "capsule.resolveOptionalDep")
private boolean resolveOptionalDep = false;

@Parameter(property = "capsule.execPluginConfig")
private String execPluginConfig = null;
@Parameter(property = "capsule.customDescriptor", defaultValue = "-capsule")
private String customDescriptor = null;
@Parameter(property = "capsule.customDescriptor")
private String customDescriptor = "-capsule";
@Parameter
private Pair<String, String>[] properties = null; // System-Properties for the app
@Parameter
Expand Down Expand Up @@ -378,7 +380,7 @@ private void addManifest(final JarOutputStream jar) throws IOException {
mainAttributes.put(new Attributes.Name("Dependencies"), dependencyString);

final String repoString = repoString().trim();
if (!repoString.isEmpty())
if (!repoString.isEmpty() && setManifestRepos)
mainAttributes.put(new Attributes.Name("Repositories"), repoString);

// add MavenCapsule caplet (if needed) & others specified by user
Expand Down Expand Up @@ -639,14 +641,14 @@ private void addDependencySets(final JarOutputStream jar) throws IOException {
}

private void addChmodCopy(final File jar) throws IOException {
if (this.chmod.equals("true") || this.chmod.equals("1")) {
if (this.chmod) {
final File file = createExecCopyProcess(jar, EXEC_PREFIX, ".x");
info("[Capsule CHMOD]: " + file.getName());
}
}

private void addTrampolineCopy(final File jar) throws IOException {
if (this.trampoline.equals("true") || this.trampoline.equals("1")) {
if (this.trampoline) {
final File file = createExecCopyProcess(jar, EXEC_TRAMPOLINE_PREFIX, ".tx");
info("[Capsule Trampoline]: " + file.getName());
}
Expand Down

0 comments on commit 169d834

Please sign in to comment.