karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [karaf] branch karaf-4.2.x updated: [KARAF-6274] Karaf 4.2.5 maven plugin breaks if no archives are generated
Date Tue, 07 May 2019 18:27:33 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch karaf-4.2.x
in repository https://gitbox.apache.org/repos/asf/karaf.git

The following commit(s) were added to refs/heads/karaf-4.2.x by this push:
     new a4d08b2  [KARAF-6274] Karaf 4.2.5 maven plugin breaks if no archives are generated
a4d08b2 is described below

commit a4d08b209bdfdb9fee3a5515a8da15447f2293a1
Author: Lars Kiesow <lkiesow@uos.de>
AuthorDate: Mon May 6 16:31:08 2019 +0200

    [KARAF-6274] Karaf 4.2.5 maven plugin breaks if no archives are generated
    Karaf 4.2.5 includes a line checking if archiveTarGz or archiveZip is
    selected, throwing an error otherwise. Unfortunately, this line breaks
    our build and a few of our use cases where we do not pack our
    For example, we have a development assembly which we have end up in a
    special folder unpacked and prepared to be launched. We could, of
    course, pack and then automatically unpack it but that would just be a
    waste of time.
    We also have some assemblies which we pack with additional files
    (documentation, …) which is handled separately. Again a use-case for
    assemblies unpacked by the karaf-maven-plugin.
    The change in question is commit 7da5044 (pull request #811)
 .../src/main/java/org/apache/karaf/tooling/ArchiveMojo.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
index a9bdb45..a99634a 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
@@ -115,11 +115,13 @@ public class ArchiveMojo extends MojoSupport {
     public void execute() throws MojoExecutionException, MojoFailureException {
         org.apache.maven.artifact.Artifact artifact = project.getArtifact();
-        try {
-            if (project.getPackaging().equals("karaf-assembly") && !archiveTarGz
&& !archiveZip) {
-                throw new IllegalArgumentException("For karaf-assembly packaging, you have
to specify at least one archive type (tar.gz or zip)");
-            }
+        // abort if there are no archives to be created
+        if (!archiveTarGz && !archiveZip) {
+            return;
+        }
+        try {
             if (project.getPackaging().equals("karaf-assembly")) {
                 if (archiveZip) {
                     archive("zip", false, true);

View raw message