From 169d83402eb7786f80b702d9ed16d7513093d2c1 Mon Sep 17 00:00:00 2001 From: chrisdchristo Date: Fri, 18 Nov 2016 16:00:08 -0500 Subject: [PATCH] preparing for 1.4.2 --- README.md | 5 +- .../chrisdchristo/capsule/CapsuleMojo.java | 62 ++++++++++--------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index ef6f995..28bb2c2 100644 --- a/README.md +++ b/README.md @@ -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. @@ -727,6 +727,7 @@ Note that if you do specify the ``, `` or `JVM-Args` (in t * ` (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 `` at root will be used instead of a particular execution. The exec's `` will map to Capsule's ``. The exec's `` will map to capsule's ``. If you specify this tag then the `` tag does not need to present. * ` (Optional)`: The system properties to provide the app with. * ` (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 `````` and ``````. +* ` (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```. * ` (Optional)`: Specify whether the app itself should be embedded. Default is true. Also, this is ignored if `````` is present. * ` (Optional)`: Specify whether compile scope dependencies should be embedded. Default is true. Also, this is ignored if `````` is present. * ` (Optional)`: Specify whether runtime scope dependencies should be embedded. Default is true. Also, this is ignored if `````` is present. diff --git a/src/main/java/com/github/chrisdchristo/capsule/CapsuleMojo.java b/src/main/java/com/github/chrisdchristo/capsule/CapsuleMojo.java index d7b0ff1..ce88913 100644 --- a/src/main/java/com/github/chrisdchristo/capsule/CapsuleMojo.java +++ b/src/main/java/com/github/chrisdchristo/capsule/CapsuleMojo.java @@ -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[] properties = null; // System-Properties for the app @Parameter @@ -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 @@ -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()); }