Skip to content

Commit

Permalink
Remove useless Add-Exports in Manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Dec 12, 2023
1 parent d8f1db5 commit ee9601f
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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";

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ee9601f

Please sign in to comment.