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

ecki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new d0fd2bc59 [COMPRESS-676] OSGi deps: commons-io optional and remove 
unknown
d0fd2bc59 is described below

commit d0fd2bc59bfa90aee4bb5f46b22b860bbe9edfd2
Author: Bernd Eckenfels <b.eckenf...@seeburger.de>
AuthorDate: Tue Mar 26 20:56:36 2024 +0100

    [COMPRESS-676] OSGi deps: commons-io optional and remove unknown
---
 pom.xml                                                    |  4 ++--
 src/changes/changes.xml                                    |  1 +
 .../org/apache/commons/compress/osgi/Configurations.java   | 14 +++++++++++---
 .../compress/osgi/OsgiWithoutOptionalDepsITest.java        |  2 +-
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5683ce0e8..6edf96e0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,8 +61,8 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
       com.github.luben.zstd;resolution:=optional,
       org.objectweb.asm;resolution:=optional,
       javax.crypto.*;resolution:=optional,
-      org.apache.commons.commons-codec;resolution:=optional,
-      org.apache.commons.commons-io;resolution:=optional,
+      org.apache.commons.io;resolution:=optional,
+      org.apache.commons.io.*;resolution:=optional,
       org.apache.commons.lang3.reflect;resolution:=optional,
       org.apache.commons.codec;resolution:=optional,
       org.apache.commons.codec.digest;resolution:=optional,
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index be42ca5dc..73fccb337 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -48,6 +48,7 @@ The <action> type attribute can be add,update,fix,remove.
       <!-- FIX -->
       <action type="fix" issue="COMPRESS-665" dev="ggregory" due-to="Gary 
Gregory, Elliotte Rusty Harold">Deprecate 
org.apache.commons.compress.utils.CharsetNames in favor or 
java.nio.charset.StandardCharsets.</action>
       <action type="fix" issue="COMPRESS-674" dev="ggregory" due-to="Gren 
Elliot">Validate TarArchiveEntry checksums #500.</action>
+      <action type="fix" issue="COMPRESS-676" dev="ecki" due-to="Martin 
Schneider">OSGi: Remove unresolvable dependencies in manifest and make the 
commons-io packages really optional.</action>
       <!-- UPDATE -->
       <action type="update" dev="ggregory" due-to="Dependabot, Gary 
Gregory">Bump org.apache.commons:commons-parent from 66 to 67 #495.</action>
       <action type="update" dev="ggregory" due-to="Dependabot, Gary 
Gregory">Bump org.ow2.asm:asm from 9.6 to 9.7 #504.</action>
diff --git a/src/test/java/org/apache/commons/compress/osgi/Configurations.java 
b/src/test/java/org/apache/commons/compress/osgi/Configurations.java
index 9a6b5e2dd..95c6edb8d 100644
--- a/src/test/java/org/apache/commons/compress/osgi/Configurations.java
+++ b/src/test/java/org/apache/commons/compress/osgi/Configurations.java
@@ -39,12 +39,20 @@ final class Configurations {
         return 
mavenBundle().groupId("commons-codec").artifactId("commons-codec").version("1.16.0");
     }
 
-    public static Option[] getConfigWithoutCommonsCodec() {
+    /**
+     * @return The maven bundle for Apache commons-io
+     */
+    private static MavenArtifactProvisionOption getCommonsIO() {
+        return 
mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.15.1");
+    }
+
+    public static Option[] getConfigWithoutOptionals() {
         final Option[] defaultConfig = getDefaultConfig();
         final Option[] result = Arrays.stream(defaultConfig)
                 .filter(o -> !getCommonsCodec().equals(o))
+                .filter(o -> !getCommonsIO().equals(o))
                 .toArray(Option[]::new);
-        Assertions.assertTrue(result.length < defaultConfig.length, "Expected 
to have removed an option.");
+        Assertions.assertTrue(result.length < defaultConfig.length, "Expected 
to have removed options.");
         return result;
     }
 
@@ -55,7 +63,7 @@ final class Configurations {
                 
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.scr").version("2.0.14"),
                 
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.8.16"),
                 getCommonsCodec(),
-                
mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.15.1"),
+                getCommonsIO(),
                 composite(systemProperty("pax.exam.invoker").value("junit"), 
bundle("link:classpath:META-INF/links/org.ops4j.pax.tipi.junit.link"),
                         
bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link"),
                         
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").version("1.3_1")),
diff --git 
a/src/test/java/org/apache/commons/compress/osgi/OsgiWithoutOptionalDepsITest.java
 
b/src/test/java/org/apache/commons/compress/osgi/OsgiWithoutOptionalDepsITest.java
index 0f0f7b856..b844888ee 100644
--- 
a/src/test/java/org/apache/commons/compress/osgi/OsgiWithoutOptionalDepsITest.java
+++ 
b/src/test/java/org/apache/commons/compress/osgi/OsgiWithoutOptionalDepsITest.java
@@ -29,6 +29,6 @@ public class OsgiWithoutOptionalDepsITest  extends 
AbstractOsgiITest {
     @Configuration
     @Override
     public Option[] config() {
-        return Configurations.getConfigWithoutCommonsCodec();
+        return Configurations.getConfigWithoutOptionals();
     }
 }

Reply via email to