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-shade-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 78105b3  fix: write Maven namespace by default (#859)
78105b3 is described below

commit 78105b3944880aa2b985a6279db1676c89377b41
Author: Efe <[email protected]>
AuthorDate: Mon Nov 2 13:58:35 2026 +0300

    fix: write Maven namespace by default (#859)
    
    Signed-off-by: Efe Gökdemir <[email protected]>
---
 .../apache/maven/plugins/shade/pom/PomWriter.java  |  2 +-
 .../maven/plugins/shade/pom/PomWriterTest.java     | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/plugins/shade/pom/PomWriter.java 
b/src/main/java/org/apache/maven/plugins/shade/pom/PomWriter.java
index 14001c2..e2546dc 100644
--- a/src/main/java/org/apache/maven/plugins/shade/pom/PomWriter.java
+++ b/src/main/java/org/apache/maven/plugins/shade/pom/PomWriter.java
@@ -32,7 +32,7 @@ import org.jdom2.output.Format;
  */
 public class PomWriter {
     public static void write(Writer w, Model newModel) throws IOException {
-        write(w, newModel, false);
+        write(w, newModel, true);
     }
 
     public static void write(Writer w, Model newModel, boolean 
namespaceDeclaration) throws IOException {
diff --git 
a/src/test/java/org/apache/maven/plugins/shade/pom/PomWriterTest.java 
b/src/test/java/org/apache/maven/plugins/shade/pom/PomWriterTest.java
new file mode 100644
index 0000000..1bdeae4
--- /dev/null
+++ b/src/test/java/org/apache/maven/plugins/shade/pom/PomWriterTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.plugins.shade.pom;
+
+import java.io.StringWriter;
+
+import org.apache.maven.model.Model;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class PomWriterTest {
+
+    @Test
+    void writesMavenNamespaceByDefault() throws Exception {
+        Model model = new Model();
+        model.setModelVersion("4.0.0");
+        StringWriter output = new StringWriter();
+
+        PomWriter.write(output, model);
+
+        
assertTrue(output.toString().contains("xmlns=\"http://maven.apache.org/POM/4.0.0\"";));
+    }
+}

Reply via email to