Author: snicoll Date: Sat Aug 25 05:42:36 2012 New Revision: 1377219 URL: http://svn.apache.org/viewvc?rev=1377219&view=rev Log: MEAR-141: support of env-entries in generated application.xml, based on a patch from Jim Brownfield. Applied again with a fix for the IT with Maven 2
Added: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java (with props) maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/specifying-env-entries-for-the-generated-application-xml.apt.vm maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml (with props) maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml (with props) Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriterContext.java maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java maven/plugins/trunk/maven-ear-plugin/src/site/apt/index.apt maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt maven/plugins/trunk/maven-ear-plugin/src/site/site.xml maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/pom.xml?rev=1377219&r1=1377218&r2=1377219&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-ear-plugin/pom.xml Sat Aug 25 05:42:36 2012 @@ -126,7 +126,7 @@ under the License. <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>3.8.1</version> + <version>4.8.1</version> <scope>test</scope> </dependency> </dependencies> 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=1377219&r1=1377218&r2=1377219&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 Sat Aug 25 05:42:36 2012 @@ -111,6 +111,14 @@ final class ApplicationXmlWriter securityRole.appendSecurityRole( writer ); } + if ( version.ge( JavaEEVersion.Six ) ) + { + for ( EnvEntry envEntry : context.getEnvEntries() ) + { + envEntry.appendEnvEntry( writer ); + } + } + if ( version.ge( JavaEEVersion.Five ) ) { writeLibraryDirectory( context.getLibraryDirectory(), writer ); Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriterContext.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriterContext.java?rev=1377219&r1=1377218&r2=1377219&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriterContext.java (original) +++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriterContext.java Sat Aug 25 05:42:36 2012 @@ -36,6 +36,8 @@ class ApplicationXmlWriterContext private final List<EarModule> earModules; private final List<SecurityRole> securityRoles; + + private final List<EnvEntry> envEntries; private final String displayName; @@ -47,13 +49,15 @@ class ApplicationXmlWriterContext private final Boolean initializeInOrder; - public ApplicationXmlWriterContext( File destinationFile, List<EarModule> earModules, List<SecurityRole> securityRoles, String displayName, + public ApplicationXmlWriterContext( File destinationFile, List<EarModule> earModules, List<SecurityRole> securityRoles, + List<EnvEntry> envEntries, String displayName, String description, String libraryDirectory, String applicationName, Boolean initializeInOrder ) { this.destinationFile = destinationFile; this.earModules = earModules; this.securityRoles = securityRoles; + this.envEntries = envEntries; this.displayName = displayName; this.description = description; this.libraryDirectory = libraryDirectory; @@ -92,6 +96,16 @@ class ApplicationXmlWriterContext } /** + * Returns the list of {@link EnvEntry} instances (as per JavaEE 6). + * + * @return the env-entry elements + */ + public List<EnvEntry> getEnvEntries() + { + return envEntries; + } + + /** * Returns the display name. * * @return the display name Added: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java (added) +++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java Sat Aug 25 05:42:36 2012 @@ -0,0 +1,141 @@ +package org.apache.maven.plugin.ear; + +/* + * 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. + */ + +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.XMLWriter; + +/** + * The representation of a env-entry entry within an + * application.xml file. + * + * @author Jim Brownfield based on code by <a href="snic...@apache.org">Stephane Nicoll</a> + * @version $Id$ + */ +class EnvEntry +{ + + static final String ENV_ENTRY = "env-entry"; + + static final String DESCRIPTION = "description"; + + static final String ENV_ENTRY_NAME = "env-entry-name"; + + static final String ENV_ENTRY_TYPE = "env-entry-type"; + + static final String ENV_ENTRY_VALUE = "env-entry-value"; + + private final String description; + + private final String name; + + private final String type; + + private final String value; + + public EnvEntry( String description, String name, String type, String value ) + { + if ( StringUtils.isEmpty( name ) ) + { + throw new IllegalArgumentException( ENV_ENTRY_NAME + " in " + ENV_ENTRY + " element cannot be null." ); + } + else if ( StringUtils.isEmpty( type ) && StringUtils.isEmpty( value ) ) + { + throw new IllegalArgumentException( + ENV_ENTRY_TYPE + " in " + ENV_ENTRY + " element cannot be null if no " + ENV_ENTRY_VALUE + + " was specified." ); + + } + + this.description = description; + this.name = name; + this.type = type; + this.value = value; + } + + public String getDescription() + { + return description; + } + + public String getName() + { + return name; + } + + public String getType() + { + return type; + } + + public String getValue() + { + return value; + } + + /** + * Appends the <tt>XML</tt> representation of this env-entry. + * + * @param writer the writer to use + */ + public void appendEnvEntry( XMLWriter writer ) + { + writer.startElement( ENV_ENTRY ); + + // description + if ( getDescription() != null ) + { + doWriteElement( writer, DESCRIPTION, getDescription() ); + } + + // env entry name + doWriteElement( writer, ENV_ENTRY_NAME, getName() ); + + // env entry type + if ( getType() != null ) + { + doWriteElement( writer, ENV_ENTRY_TYPE, getType() ); + } + + // env entry value + if ( getValue() != null ) + { + doWriteElement( writer, ENV_ENTRY_VALUE, getValue() ); + } + + // end of env-entry + writer.endElement(); + } + + + private void doWriteElement( XMLWriter writer, String element, String text ) + { + writer.startElement( element ); + writer.writeText( text ); + writer.endElement(); + } + + public String toString() + { + return "env-entry [name=" + getName() + ", type=" + getType() + ", value=" + getValue() + "]"; + } + + +} \ No newline at end of file Propchange: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java?rev=1377219&r1=1377218&r2=1377219&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java (original) +++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java Sat Aug 25 05:42:36 2012 @@ -100,6 +100,12 @@ public class GenerateApplicationXmlMojo @Parameter private PlexusConfiguration security; + /** + * The env-entries to be added to the auto-generated + * application.xml file. Since JavaEE6. + */ + @Parameter( alias = "env-entries" ) + private PlexusConfiguration envEntries; public void execute() throws MojoExecutionException, MojoFailureException @@ -185,8 +191,9 @@ public class GenerateApplicationXmlMojo final ApplicationXmlWriter writer = new ApplicationXmlWriter( javaEEVersion, encoding, generateModuleId ); final ApplicationXmlWriterContext context = - new ApplicationXmlWriterContext( descriptor, getModules(), buildSecurityRoles(), displayName, description, - defaultLibBundleDir, applicationName, initializeInOrder ); + new ApplicationXmlWriterContext( descriptor, getModules(), buildSecurityRoles(), buildEnvEntries(), + displayName, description, defaultLibBundleDir, applicationName, + initializeInOrder ); writer.write( context ); } @@ -254,4 +261,47 @@ public class GenerateApplicationXmlMojo } } + + /** + * Builds the env-entries based on the configuration. + * + * @return a list of EnvEntry object(s) + * @throws EarPluginException if the configuration is invalid + */ + private List<EnvEntry> buildEnvEntries() + throws EarPluginException + { + final List<EnvEntry> result = new ArrayList<EnvEntry>(); + if ( envEntries == null ) + { + return result; + } + try + { + final PlexusConfiguration[] allEnvEntries = envEntries.getChildren( EnvEntry.ENV_ENTRY ); + + for ( PlexusConfiguration envEntry : allEnvEntries ) + { + final String description = envEntry.getChild( EnvEntry.DESCRIPTION ).getValue(); + final String envEntryName = envEntry.getChild( EnvEntry.ENV_ENTRY_NAME ).getValue(); + final String envEntryType = envEntry.getChild( EnvEntry.ENV_ENTRY_TYPE ).getValue(); + final String envEntryValue = envEntry.getChild( EnvEntry.ENV_ENTRY_VALUE ).getValue(); + + try + { + result.add( new EnvEntry( description, envEntryName, envEntryType, envEntryValue ) ); + } + catch ( IllegalArgumentException e ) + { + throw new EarPluginException( "Invalid env-entry [" + envEntry + "]", e ); + } + } + return result; + } + catch ( PlexusConfigurationException e ) + { + throw new EarPluginException( "Invalid env-entry configuration", e ); + } + + } } \ No newline at end of file Added: maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/specifying-env-entries-for-the-generated-application-xml.apt.vm URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/specifying-env-entries-for-the-generated-application-xml.apt.vm?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/specifying-env-entries-for-the-generated-application-xml.apt.vm (added) +++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/examples/specifying-env-entries-for-the-generated-application-xml.apt.vm Sat Aug 25 05:42:36 2012 @@ -0,0 +1,62 @@ + ------ + Specifying Security Roles For The Generated application.xml + ------ + Stephane Nicoll + <snic...@apache.org> + ------ + January 25, 2012 + +~~ Copyright 2006 The Apache Software Foundation. +~~ +~~ Licensed 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/doxia/references/apt-format.html + + +Specifying Environment entries For The Generated application.xml + + Environment entries can be added as from the JavaEE 6 spec. For instance: + ++-------- + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ear-plugin</artifactId> + <version>${project.version}</version> + <configuration> + [...] + <version>6</version> + [...] + <env-entries> + <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> + </env-entries> + </configuration> + </plugin> + </plugins> + </build> ++--------- Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/index.apt?rev=1377219&r1=1377218&r2=1377219&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/site/apt/index.apt (original) +++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/index.apt Sat Aug 25 05:42:36 2012 @@ -124,6 +124,9 @@ Maven EAR Plugin * {{{./examples/specifying-security-roles-for-the-generated-application-xml.html} Specifying Security Roles For The Generated application.xml}} + * {{{./examples/specifying-env-entries-for-the-generated-application-xml.html} + Specifying Environment Entries For The Generated application.xml}} + * {{{./examples/generating-jboss-app.html} Generating the jboss-app.xml file}} * {{{./examples/generating-modules-id.html} Generating modules id}} Modified: maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt?rev=1377219&r1=1377218&r2=1377219&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt (original) +++ maven/plugins/trunk/maven-ear-plugin/src/site/apt/tests.apt Sat Aug 25 05:42:36 2012 @@ -176,4 +176,12 @@ EAR Plugin Tests * project-073: builds an EAR with an application client module (app-client) and a default bundle directory for _java_ modules + * project-074: builds an EAR with custom env entries settings and J2EE 1.3 (Not supported by the specification) + + * project-075: builds an EAR with custom env entries settings and J2EE 1.4 (Not supported by the specification) + + * project-076: builds an EAR with custom env entries settings and JavaEE 5 (Not supported by the specification) + + * project-077: builds an EAR with custom env entries settings and JavaEE 6 + * project-078: builds an EAR with the no version for ejb file name mapping Modified: maven/plugins/trunk/maven-ear-plugin/src/site/site.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/site/site.xml?rev=1377219&r1=1377218&r2=1377219&view=diff ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/site/site.xml (original) +++ maven/plugins/trunk/maven-ear-plugin/src/site/site.xml Sat Aug 25 05:42:36 2012 @@ -46,6 +46,7 @@ under the License. <item name="Unpacking A Module" href="examples/unpacking-a-module.html"/> <item name="Including A Third Party Library In application.xml" href="examples/including-a-third-party-library-in-application-xml.html"/> <item name="Specifying Security Roles For The Generated application.xml" href="examples/specifying-security-roles-for-the-generated-application-xml.html"/> + <item name="Specifying Environment Entries In application.xml" href="examples/specifying-env-entries-for-the-generated-application-xml.html"/> <item name="Generating jboss-app.xml" href="examples/generating-jboss-app.html"/> <item name="Customize file name mapping" href="examples/customize-file-name-mapping.html"/> <item name="Generating modules ID" href="examples/generating-modules-id.html"/> Added: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java Sat Aug 25 05:42:36 2012 @@ -0,0 +1,73 @@ +package org.apache.maven.plugin.ear; + +import org.junit.Test; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; + +/** + * @author Stephane Nicoll + */ +public class EnvEntryTest +{ + + public static final String DESCRIPTION = "description"; + + public static final String NAME = "name"; + + public static final String TYPE = Integer.class.getName(); + + public static final String VALUE = "34"; + + @Test + public void createComplete() + { + final EnvEntry envEntry = new EnvEntry( DESCRIPTION, NAME, TYPE, VALUE ); + assertEnvEntry( envEntry, DESCRIPTION, NAME, TYPE, VALUE ); + } + + @Test + public void createWithoutTypeButValue() + { + final EnvEntry envEntry = new EnvEntry( null, NAME, null, VALUE ); + assertEnvEntry( envEntry, null, NAME, null, VALUE ); + } + + @Test( expected = IllegalArgumentException.class ) + public void createWithoutName() + { + new EnvEntry( DESCRIPTION, null, TYPE, VALUE ); + + } + + @Test( expected = IllegalArgumentException.class ) + public void createWithEmptyName() + { + new EnvEntry( DESCRIPTION, "", TYPE, VALUE ); + } + + @Test( expected = IllegalArgumentException.class ) + public void createWithNullTypeAndNoValue() + { + new EnvEntry( DESCRIPTION, NAME, null, null ); + + } + + @Test( expected = IllegalArgumentException.class ) + public void createWithEmptyTypeAndNoValue() + { + new EnvEntry( DESCRIPTION, NAME, "", null ); + + } + + private void assertEnvEntry( EnvEntry actual, String description, String name, String type, String value ) + { + assertNotNull( "Env entry could not be null", actual ); + assertNotNull( "ToString could not be null", actual.toString() ); + assertEquals( "Wrong env entry description for [" + actual + "]", description, actual.getDescription() ); + assertEquals( "Wrong env entry name for [" + actual + "]", name, actual.getName() ); + assertEquals( "Wrong env entry type for [" + actual + "]", type, actual.getType() ); + assertEquals( "Wrong env entry value for [" + actual + "]", value, actual.getValue() ); + + } +} Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/java/org/apache/maven/plugin/ear/EnvEntryTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain 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=1377219&r1=1377218&r2=1377219&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 Sat Aug 25 05:42:36 2012 @@ -774,6 +774,45 @@ public class EarMojoIT } /** + * Builds an EAR with custom env entries settings and J2EE 1.3. Not supported by the specification + * so this should be ignored. + */ + public void testProject074() + throws Exception + { + doTestProject( "project-074", new String[]{ "ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar" } ); + } + + /** + * Builds an EAR with custom env entries settings and J2EE 1.4. Not supported by the specification + * so this should be ignored. + */ + public void testProject075() + throws Exception + { + doTestProject( "project-075", new String[]{ "ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar" } ); + } + + /** + * Builds an EAR with custom env entries settings and JavaEE 5. Not supported by the specification + * so this should be ignored. + */ + public void testProject076() + throws Exception + { + doTestProject( "project-076", new String[]{ "ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar" } ); + } + + /** + * Builds an EAR with custom env entries settings and JavaEE 6. + */ + public void testProject077() + throws Exception + { + doTestProject( "project-077", new String[]{ "ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar" } ); + } + + /** * Builds an EAR with the no version for ejb file name mapping. */ public void testProject078() Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml Sat Aug 25 05:42:36 2012 @@ -0,0 +1,32 @@ +<?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. +--> + +<!DOCTYPE application PUBLIC + "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" + "http://java.sun.com/dtd/application_1_3.dtd"> +<application> + <display-name>maven-ear-plugin-test-project-074</display-name> + <module> + <ejb>ejb-sample-one-1.0.jar</ejb> + </module> + <module> + <ejb>ejb-sample-two-1.0.jar</ejb> + </module> +</application> Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml Sat Aug 25 05:42:36 2012 @@ -0,0 +1,63 @@ +<?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-074</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> + <!-- This is ignored with version 1.3 as this is not supported --> + <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> + </envEntries> + </configuration> + </plugin> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-074/pom.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml Sat Aug 25 05:42:36 2012 @@ -0,0 +1,29 @@ +<?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/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4"> + <display-name>maven-ear-plugin-test-project-075</display-name> + <module> + <ejb>ejb-sample-one-1.0.jar</ejb> + </module> + <module> + <ejb>ejb-sample-two-1.0.jar</ejb> + </module> +</application> Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml Sat Aug 25 05:42:36 2012 @@ -0,0 +1,64 @@ +<?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-075</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>1.4</version> + <!-- This is ignored with version 1.4 as this is not supported --> + <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> + </envEntries> + </configuration> + </plugin> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-075/pom.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml Sat Aug 25 05:42:36 2012 @@ -0,0 +1,29 @@ +<?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_5.xsd" version="5"> + <display-name>maven-ear-plugin-test-project-076</display-name> + <module> + <ejb>ejb-sample-one-1.0.jar</ejb> + </module> + <module> + <ejb>ejb-sample-two-1.0.jar</ejb> + </module> +</application> Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml Sat Aug 25 05:42:36 2012 @@ -0,0 +1,64 @@ +<?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-076</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>5</version> + <!-- This is ignored with version 5 as this is not supported --> + <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> + </envEntries> + </configuration> + </plugin> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-076/pom.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml Sat Aug 25 05:42:36 2012 @@ -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-077</display-name> + <module> + <ejb>ejb-sample-one-1.0.jar</ejb> + </module> + <module> + <ejb>ejb-sample-two-1.0.jar</ejb> + </module> + <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> + Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/expected-META-INF/application.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml?rev=1377219&view=auto ============================================================================== --- maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml (added) +++ maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml Sat Aug 25 05:42:36 2012 @@ -0,0 +1,71 @@ +<?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-077</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> + </configuration> + </plugin> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/project-077/pom.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml