You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2026/02/01 10:15:47 UTC

(karaf) branch dependabot/maven/karaf-4.4.x/org.codehaus.plexus-plexus-archiver-4.11.0 created (now d9f520ba64)

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a change to branch dependabot/maven/karaf-4.4.x/org.codehaus.plexus-plexus-archiver-4.11.0
in repository https://gitbox.apache.org/repos/asf/karaf.git


      at d9f520ba64 Bump org.codehaus.plexus:plexus-archiver from 4.2.7 to 4.11.0 (#2224)

This branch includes the following new commits:

     new d9f520ba64 Bump org.codehaus.plexus:plexus-archiver from 4.2.7 to 4.11.0 (#2224)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(karaf) 01/01: Bump org.codehaus.plexus:plexus-archiver from 4.2.7 to 4.11.0 (#2224)

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch dependabot/maven/karaf-4.4.x/org.codehaus.plexus-plexus-archiver-4.11.0
in repository https://gitbox.apache.org/repos/asf/karaf.git

commit d9f520ba64e9dd2c28ff01803b07f407bba35582
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Sun Feb 1 11:14:31 2026 +0100

    Bump org.codehaus.plexus:plexus-archiver from 4.2.7 to 4.11.0 (#2224)
    
    * Bump org.codehaus.plexus:plexus-archiver from 4.2.7 to 4.11.0
    
    Bumps [org.codehaus.plexus:plexus-archiver](https://github.com/codehaus-plexus/plexus-archiver) from 4.2.7 to 4.11.0.
    - [Release notes](https://github.com/codehaus-plexus/plexus-archiver/releases)
    - [Changelog](https://github.com/codehaus-plexus/plexus-archiver/blob/master/ReleaseNotes.md)
    - [Commits](https://github.com/codehaus-plexus/plexus-archiver/compare/plexus-archiver-4.2.7...plexus-archiver-4.11.0)
    
    ---
    updated-dependencies:
    - dependency-name: org.codehaus.plexus:plexus-archiver
      dependency-version: 4.11.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <su...@github.com>
    
    * Fix the way to deal with temp files in the KarMojo
    
    ---------
    
    Signed-off-by: dependabot[bot] <su...@github.com>
    Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
    Co-authored-by: JB Onofré <jb...@dremio.com>
---
 tooling/karaf-maven-plugin/pom.xml                 |  2 +-
 .../java/org/apache/karaf/tooling/KarMojo.java     | 25 ++++++++++++++--------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/tooling/karaf-maven-plugin/pom.xml b/tooling/karaf-maven-plugin/pom.xml
index a8d541340c..c450a284ba 100644
--- a/tooling/karaf-maven-plugin/pom.xml
+++ b/tooling/karaf-maven-plugin/pom.xml
@@ -169,7 +169,7 @@
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-archiver</artifactId>
-            <version>4.2.7</version>
+            <version>4.11.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/KarMojo.java b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/KarMojo.java
index 75b96aa6fe..9c7b7d003a 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/KarMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/KarMojo.java
@@ -50,13 +50,13 @@ import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 /**
  * Assemble a kar archive from a features.xml file
@@ -75,7 +75,8 @@ public class KarMojo extends MojoSupport {
     /**
      * The Jar archiver.
      */
-    @Component(role = Archiver.class, hint="jar")
+    @Inject
+    @Named("jar")
     private JarArchiver jarArchiver = null;
 
     /**
@@ -264,6 +265,7 @@ public class KarMojo extends MojoSupport {
         // configure for Reproducible Builds based on outputTimestamp value
         archiver.configureReproducible(outputTimestamp);
 
+        List<File> tempMetadataFiles = new ArrayList<>();
         try {
             //TODO should .kar be a bundle?
 //            archive.addManifestEntry(Constants.BUNDLE_NAME, project.getName());
@@ -345,12 +347,7 @@ public class KarMojo extends MojoSupport {
                     }
 
                     jarArchiver.addFile(metadataTmp, repositoryPath + layout.pathOf(artifact).substring(0, layout.pathOf(artifact).lastIndexOf('/')) + "/maven-metadata-local.xml");
-
-                    try {
-                        metadataTmp.delete();
-                    } catch (final Exception ex) {
-                        getLog().warn("Cannot delete temporary created file.", ex);
-                    }
+                    tempMetadataFiles.add(metadataTmp);
                 }
 
                 String targetFileName = repositoryPath + layout.pathOf(artifact);
@@ -362,6 +359,16 @@ public class KarMojo extends MojoSupport {
             }
             archiver.createArchive(mavenSession, project, archive);
 
+            for (File tempMetadataFile : tempMetadataFiles) {
+                try {
+                    if (!tempMetadataFile.delete()) {
+                        getLog().warn("Cannot delete temporary created file: " + tempMetadataFile.getAbsolutePath());
+                    }
+                } catch (final Exception ex) {
+                    getLog().warn("Cannot delete temporary created file: " + tempMetadataFile.getAbsolutePath(), ex);
+                }
+            }
+
             return archiveFile;
         } catch (Exception e) {
             throw new MojoExecutionException("Failed to create archive", e);