This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-war-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new f41b9f7 Inline cargo cult constants (#588)
f41b9f7 is described below
commit f41b9f792cde9891eea67f994f2b22b2ed632c6f
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Mon Nov 24 13:15:14 2025 -0600
Inline cargo cult constants (#588)
* Inline cargo cult constants
* format
* avoid string concatenation
---
src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java
b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java
index 709e2e7..4a7930f 100644
--- a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java
@@ -63,9 +63,7 @@ import
org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
* Contains common jobs for WAR mojos.
*/
public abstract class AbstractWarMojo extends AbstractMojo {
- private static final String META_INF = "META-INF";
- private static final String WEB_INF = "WEB-INF";
/**
* Whether to fail the build if the <code>web.xml</code> file is missing.
Set to <code>false</code> if you
* want your WAR built without a <code>web.xml</code> file. This may be
useful if you are building an overlay that
@@ -417,12 +415,12 @@ public abstract class AbstractWarMojo extends
AbstractMojo {
// if webXML is specified, omit the one in the source directory
if (webXml != null && StringUtils.isNotEmpty(webXml.getName())) {
- excludeList.add("**/" + WEB_INF + "/web.xml");
+ excludeList.add("**/WEB-INF/web.xml");
}
// if contextXML is specified, omit the one in the source directory
if (containerConfigXML != null &&
StringUtils.isNotEmpty(containerConfigXML.getName())) {
- excludeList.add("**/" + META_INF + "/" +
containerConfigXML.getName());
+ excludeList.add("**/META-INF/" + containerConfigXML.getName());
}
return excludeList.toArray(new String[excludeList.size()]);