You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2018/01/16 19:28:49 UTC

[maven-ear-plugin] 01/01: First step in direction to JavaEE 8 support.

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 ab216a525263b587935aa8c8823e1cc761c93656
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Tue Jan 16 20:27:31 2018 +0100

    First step in direction to JavaEE 8 support.
---
 .../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
"commits@maven.apache.org" <co...@maven.apache.org>.