From ee9601f7f86610397a94a25bc79ee846ceb0feeb Mon Sep 17 00:00:00 2001 From: Jean-Francois Denise Date: Wed, 6 Dec 2023 10:49:49 +0100 Subject: [PATCH] Remove useless Add-Exports in Manifest --- .../bootablejar/maven/cloud/CloudConfig.java | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/plugin/src/main/java/org/wildfly/plugins/bootablejar/maven/cloud/CloudConfig.java b/plugin/src/main/java/org/wildfly/plugins/bootablejar/maven/cloud/CloudConfig.java index 4516f769..46ef1c87 100644 --- a/plugin/src/main/java/org/wildfly/plugins/bootablejar/maven/cloud/CloudConfig.java +++ b/plugin/src/main/java/org/wildfly/plugins/bootablejar/maven/cloud/CloudConfig.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Properties; import java.util.Set; -import java.util.jar.Attributes; import java.util.jar.Manifest; import java.util.stream.Collectors; import org.apache.maven.plugin.logging.Log; @@ -46,8 +45,6 @@ */ public class CloudConfig { - private static final String ADD_EXPORTS_ATTRIBUTE = "Add-Exports"; - private static final String NAMING_JNDI_DNS_EXPORT = "jdk.naming.dns/com.sun.jndi.dns"; private static final String OPENSHIFT = "openshift"; private static final String KUBERNETES = "kubernetes"; @@ -90,20 +87,8 @@ public void validate() throws MojoExecutionException { } public boolean updateManifest(Manifest manifest) { - Attributes attributes = manifest.getMainAttributes(); - String val = attributes.getValue(ADD_EXPORTS_ATTRIBUTE); - boolean updated = true; - // needed for jgroups dns ping protocol on JDK15+ - if (val == null) { - attributes.putValue(ADD_EXPORTS_ATTRIBUTE, NAMING_JNDI_DNS_EXPORT); - } else { - if (val.contains(NAMING_JNDI_DNS_EXPORT)) { - updated = false; - } else { - attributes.putValue(ADD_EXPORTS_ATTRIBUTE, val + " " + NAMING_JNDI_DNS_EXPORT); - } - } - return updated; + // No-op currently + return false; } public void copyExtraContent(BuildBootableJarMojo mojo, Path wildflyDir, Path contentDir)