You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2013/11/10 12:22:47 UTC

svn commit: r1540462 - in /maven/plugins/trunk/maven-ear-plugin/src: main/java/org/apache/maven/plugin/ear/ test/java/org/apache/maven/plugin/ear/it/ test/resources/projects/project-083/ test/resources/projects/project-083/expected-META-INF/

Author: rfscholte
Date: Sun Nov 10 11:22:47 2013
New Revision: 1540462

URL: http://svn.apache.org/r1540462
Log:
[MEAR-158] Elements library-directory and env-entry out of sequence in application.xml for JEE 6 
Patch contributed by Fred Bricon, verified by Robert Scholte

Added:
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/   (with props)
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/   (with props)
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/application.xml
    maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/pom.xml
Modified:
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
    maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java?rev=1540462&r1=1540461&r2=1540462&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java Sun Nov 10 11:22:47 2013
@@ -115,6 +115,11 @@ final class ApplicationXmlWriter
             securityRole.appendSecurityRole( writer );
         }
 
+        if ( version.ge( JavaEEVersion.Five ) )
+        {
+            writeLibraryDirectory( context.getLibraryDirectory(), writer );
+        }
+
         if ( version.ge( JavaEEVersion.Six ) )
         {
             for ( EnvEntry envEntry : context.getEnvEntries() )
@@ -123,11 +128,6 @@ final class ApplicationXmlWriter
             }
         }
         
-        if ( version.ge( JavaEEVersion.Five ) )
-        {
-            writeLibraryDirectory( context.getLibraryDirectory(), writer );
-        }
-
         writer.endElement();
 
         close( w );

Modified: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java?rev=1540462&r1=1540461&r2=1540462&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java Sun Nov 10 11:22:47 2013
@@ -857,4 +857,14 @@ public class EarMojoIT
     {
         doTestProject( "project-082", new String[]{ "ejb-sample-one-1.0.jar"} );
     }
+    
+    /**
+     * Builds an EAR with a library directory and custom env entries. The library-directory element must come first
+     * (MEAR-158).
+     */
+    public void testProject083()
+        throws Exception
+    {
+        doTestProject( "project-083", new String[] { "ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar" } );
+    }
 }

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sun Nov 10 11:22:47 2013
@@ -0,0 +1 @@
+MEAR-\d+

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sun Nov 10 11:22:47 2013
@@ -0,0 +1 @@
+MEAR-\d+

Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/
------------------------------------------------------------------------------
    bugtraq:url = http://jira.codehaus.org/browse/%BUGID%

Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/application.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/application.xml?rev=1540462&view=auto
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/application.xml (added)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/expected-META-INF/application.xml Sun Nov 10 11:22:47 2013
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
+  <display-name>maven-ear-plugin-test-project-083</display-name>
+  <module>
+    <ejb>ejb-sample-one-1.0.jar</ejb>
+  </module>
+  <module>
+    <ejb>ejb-sample-two-1.0.jar</ejb>
+  </module>
+  <library-directory>APP-INF/lib</library-directory>
+  <env-entry>
+    <description>A complete entry.</description>
+    <env-entry-name>complete</env-entry-name>
+    <env-entry-type>java.lang.Integer</env-entry-type>
+    <env-entry-value>4</env-entry-value>
+  </env-entry>
+  <env-entry>
+    <env-entry-name>no-type</env-entry-name>
+    <env-entry-value>4</env-entry-value>
+  </env-entry>
+  <env-entry>
+    <env-entry-name>no-value</env-entry-name>
+    <env-entry-type>java.lang.String</env-entry-type>
+  </env-entry>
+</application>

Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/pom.xml?rev=1540462&view=auto
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/pom.xml (added)
+++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-083/pom.xml Sun Nov 10 11:22:47 2013
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>ear</groupId>
+  <artifactId>maven-ear-plugin-test-project-083</artifactId>
+  <version>99.0</version>
+  <name>Maven</name>
+  <packaging>ear</packaging>
+  <dependencies>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-one</artifactId>
+      <version>1.0</version>
+      <type>ejb</type>
+    </dependency>
+    <dependency>
+      <groupId>eartest</groupId>
+      <artifactId>ejb-sample-two</artifactId>
+      <version>1.0</version>
+      <type>ejb</type>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <version>6</version>
+          <envEntries>
+            <env-entry>
+              <description>A complete entry.</description>
+              <env-entry-name>complete</env-entry-name>
+              <env-entry-type>java.lang.Integer</env-entry-type>
+              <env-entry-value>4</env-entry-value>
+            </env-entry>
+            <env-entry>
+              <env-entry-name>no-type</env-entry-name>
+              <env-entry-value>4</env-entry-value>
+            </env-entry>
+            <env-entry>
+              <env-entry-name>no-value</env-entry-name>
+              <env-entry-type>java.lang.String</env-entry-type>
+            </env-entry>
+          </envEntries>
+          <defaultLibBundleDir>APP-INF/lib</defaultLibBundleDir>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>