maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject [maven-ear-plugin] 01/01: [MEAR-254] - Support JavaEE version 8
Date Sun, 04 Mar 2018 12:36:39 GMT
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch MEAR-254-JavaEE-8
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 962528d731773fd3fa83d2e0f739e0b49356e72c
Author: Karl Heinz Marbaise <khmarbaise@apache.org>
AuthorDate: Tue Jan 16 20:27:31 2018 +0100

    [MEAR-254] - Support JavaEE version 8
---
 .../apache/maven/plugins/ear/ApplicationXmlWriter.java | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/main/java/org/apache/maven/plugins/ear/ApplicationXmlWriter.java b/src/main/java/org/apache/maven/plugins/ear/ApplicationXmlWriter.java
index 6c6142d..65c7701 100644
--- a/src/main/java/org/apache/maven/plugins/ear/ApplicationXmlWriter.java
+++ b/src/main/java/org/apache/maven/plugins/ear/ApplicationXmlWriter.java
@@ -78,6 +78,10 @@ final class ApplicationXmlWriter
         {
             writer = initializeRootElementSeven( w );
         }
+        else if ( JavaEEVersion.EIGHT.eq( version ) )
+        {
+            writer = initializeRootElementEight( w );
+        }
 
         // writer is still on root element, so we can still add this attribute
         if ( context.getApplicationId() != null )
@@ -253,4 +257,18 @@ final class ApplicationXmlWriter
         writer.addAttribute( "version", "7" );
         return writer;
     }
+
+    private XMLWriter initializeRootElementEight( Writer w )
+    {
+        XMLWriter writer = initializeXmlWriter( w, null );
+        writer.startElement( APPLICATION_ELEMENT );
+        writer.addAttribute( "xmlns", "http://xmlns.jcp.org/xml/ns/javaee" );
+        writer.addAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
+        // CHECKSTYLE_OFF: LineLength
+        writer.addAttribute( "xsi:schemaLocation",
+                             "http://xmlns.jcp.org/xml/ns/javaee/ http://xmlns.jcp.org/xml/ns/javaee/application_8.xsd"
);
+        // CHECKSTYLE_ON: LineLength
+        writer.addAttribute( "version", "8" );
+        return writer;
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.

Mime
View raw message