maven-ear-plugin-2.3.2/0000755000175000017500000000000011241314103014611 5ustar twernertwernermaven-ear-plugin-2.3.2/src/0000755000175000017500000000000011241314103015400 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/0000755000175000017500000000000011241314103016014 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/basic/0000755000175000017500000000000011241314103017075 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/basic/verify.bsh0000644000175000017500000000133211137064552021114 0ustar twernertwernerimport java.io.*; import java.util.*; import java.util.jar.*; import java.util.regex.*; File jarFile = new File( basedir, "target/test-1.0.ear" ); System.out.println( "Checking for existence of " + jarFile ); if ( !jarFile.isFile() ) { throw new IllegalStateException( "Missing file: " + jarFile ); } JarFile jar = new JarFile( jarFile ); String[] includedEntries = { "META-INF/application.xml", "META-INF/appserver-application.xml", }; for ( String included : includedEntries ) { System.out.println( "Checking for existence of " + included ); if ( jar.getEntry( included ) == null ) { throw new IllegalStateException( "Missing archive entry: " + included ); } } jar.close(); return true; maven-ear-plugin-2.3.2/src/it/basic/src/0000755000175000017500000000000011241314103017664 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/basic/src/main/0000755000175000017500000000000011241314103020610 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/basic/src/main/application/0000755000175000017500000000000011241314103023113 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/basic/src/main/application/META-INF/0000755000175000017500000000000011241314103024253 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/basic/src/main/application/META-INF/appserver-application.xml0000644000175000017500000000010511066163222031312 0ustar twernertwerner maven-ear-plugin-2.3.2/src/it/basic/pom.xml0000644000175000017500000000264611137064552020440 0ustar twernertwerner 4.0.0 org.apache.maven.its.ear.basic test 1.0 ear Maven Integration Test :: it0033 Test an EAR generation org.apache.maven.plugins maven-ear-plugin @project.version@ true maven-ear-plugin-2.3.2/src/it/settings.xml0000644000175000017500000000375011123433276020417 0ustar twernertwerner it-repo true local.central @localRepositoryUrl@ true true apache.snapshots Apache Snapshot Repository http://people.apache.org/repo/m2-snapshot-repository false true local.central @localRepositoryUrl@ true true maven-ear-plugin-2.3.2/src/it/descriptor-encoding/0000755000175000017500000000000011241314103021756 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/descriptor-encoding/latin-1/0000755000175000017500000000000011241314103023223 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/descriptor-encoding/latin-1/pom.xml0000644000175000017500000000264211137064552024562 0ustar twernertwerner 4.0.0 org.apache.maven.its.ear.dde latin-1 1.0 ear MEAR-99 - Latin-1 TEST-CHARS: ÄÖÜäöüß org.apache.maven.plugins maven-ear-plugin @project.version@ ISO-8859-1 maven-ear-plugin-2.3.2/src/it/descriptor-encoding/utf-8/0000755000175000017500000000000011241314103022721 5ustar twernertwernermaven-ear-plugin-2.3.2/src/it/descriptor-encoding/utf-8/pom.xml0000644000175000017500000000263111137064552024256 0ustar twernertwerner 4.0.0 org.apache.maven.its.ear.dde utf-8 1.0 ear MEAR-99 - UTF-8 TEST-CHARS: ÄÖÜäöüß org.apache.maven.plugins maven-ear-plugin @project.version@ UTF-8 maven-ear-plugin-2.3.2/src/it/descriptor-encoding/verify.groovy0000644000175000017500000000110511137064552024544 0ustar twernertwernerdef latin1File = new File( basedir, "latin-1/target/application.xml" ) assert latin1File.exists() def latin1Chars = new XmlParser().parse( latin1File ).description.text() println "Latin-1: " + latin1Chars assert "TEST-CHARS: \u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF".equals( latin1Chars ) def utf8File = new File( basedir, "utf-8/target/application.xml" ) assert utf8File.exists() def utf8Chars = new XmlParser().parse( utf8File ).description.text() println "UTF-8: " + utf8Chars assert "TEST-CHARS: \u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF".equals( utf8Chars ) return true; maven-ear-plugin-2.3.2/src/it/descriptor-encoding/pom.xml0000644000175000017500000000314511137064552023314 0ustar twernertwerner 4.0.0 org.apache.maven.its.ear.dde test 1.0 pom MEAR-99 - Aggregator Test proper encoding handling when writing the deployment descriptors. utf-8 latin-1 org.apache.maven.plugins maven-ear-plugin @project.version@ true maven-ear-plugin-2.3.2/src/site/0000755000175000017500000000000011241314103016344 5ustar twernertwernermaven-ear-plugin-2.3.2/src/site/site.xml0000644000175000017500000000456511127632146020061 0ustar twernertwerner maven-ear-plugin-2.3.2/src/site/fml/0000755000175000017500000000000011241314103017122 5ustar twernertwernermaven-ear-plugin-2.3.2/src/site/fml/faq.fml0000644000175000017500000000334711055554323020415 0ustar twernertwerner What is an EAR archive?

An EAR archive is used to deploy standalone EJBs, usually separated from the web application. Thus, there is no need for a web application to access these EJBs. The EJBs are still accessible though using EJB clients.

The EAR Plugin throws an exception when encountering artifact types it is unfamiliar with. Is this a bug?

The exception can be prevented by adding your custom artifact type to the artifactTypeMappings configuration. There is a mini-guide on how to do that in the modules configuration section.

maven-ear-plugin-2.3.2/src/site/apt/0000755000175000017500000000000011241314103017130 5ustar twernertwernermaven-ear-plugin-2.3.2/src/site/apt/tests.apt0000644000175000017500000001501411150275561021016 0ustar twernertwerner ------ Tests ------ Stephane Nicoll ------ 29 October 2006 ------ ~~ 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 EAR Plugin Tests This page lists the ear plugin integration tests. Each tests is built on top of a sample project available in the {{{http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/test/resources/projects/}svn repository}}. This structure provides lots of concrete use cases for beginners. * project-001: builds an EAR with a single EJB and no configuration. * project-002: builds an EAR with a customized artifact location and a customized artifact name * project-003: builds an EAR with a defalt bundle directory for _java_ modules * project-004: builds an EAR with a defalt bundle directory for _java_ modules and a custom location overriding the default * project-005: builds an EAR with a custom URI * project-006: builds an EAR with an excluded module * project-007: builds an EAR with a classified artifact and no extra configuration * project-008: builds an EAR with deployment descriptor configuration for J2EE 1.3 * project-009: builds an EAR with deployment descriptor configuration for J2EE 1.4 * project-010: builds an EAR with deployment descriptor configuration for Java EE 5 * project-011: builds an EAR and make sure that deployment descriptor default settings are applied * project-012: builds an EAR and make sure that EAR resources are bundled within the EAR * project-013: builds an EAR and make sure that EAR resources in a customized resources directory are bundled within the EAR * project-014: builds an EAR and make sure that EAR resources are bundled within the EAR using includes and excludes * project-015: builds an EAR and make sure that default manifest is taken into account * project-016: builds an EAR and make sure that custom manifest is taken into account * project-017: builds an EAR and make sure that custom application.xml is taken into account * project-018: builds an EAR with a custom final name * project-019: builds an EAR with unpacked archives using the unpackTypes. * project-020: builds an EAR with unpacked archives using the unpack module attribute * project-021: builds an EAR with unpacked archives using both unpackTypes and the unpack module attribute * project-022: builds an EAR with a classifier * project-023: builds an EAR and make sure that a single classified dependency is detected without specifying the classifier * project-024: builds an EAR and make sure that a single classified dependency is detected when specifying the classifier * project-025: builds an EAR and make sure that a classified dependency with mutiple candidates is detected when specifying the classifier * project-026: builds an EAR and make sure that the build fails if a unclassifed module configuration with mutiple candidates is specified * project-027: builds an EAR and make sure that provided dependencies are not included in the EAR * project-028: builds an EAR and make sure that test dependencies are not included in the EAR * project-029: builds an EAR and make sure that system dependencies are not included in the EAR * project-030: builds an EAR and make sure that ejb-client dependencies are detected and not added by default in the generated application.xml * project-031: builds an EAR with a Jboss 4 configuration specifying the security domain and the unauthenticated-principal to use * project-032: builds an EAR with a Jboss 3.2 configuration specifying the jmx-name to use * project-033: builds an EAR with a Jboss 4 configuration and Jboss specific modules * project-034: builds an EAR with custom security settings * project-035: builds an EAR with a full filename mapping and make sure that custom locations are not overriden * project-036: builds an EAR with a full filename mapping and make sure that groupIds with dots are replaced by dashes in filenames * project-037: builds an EAR and make sure that ejb-client dependencies are detected and added in the generated application.xml if includeInApplicationXml is set * project-038: builds an EAR and make sure that a non-classified dependency with mutiple candidates is detected when specifying the mainArtifactId as classifier * project-039: builds an EAR with a Jboss 4 configuration specifying the loader repository to use * project-040: builds an EAR with deployment descriptor configuration for Java EE 5 and an alternative deployment descriptor * project-041: builds an EAR with a Jboss 4.2 configuration specifying the module order to use * project-042: builds an EAR with a Jboss 4.2 configuration specifying a datasource to add * project-043: builds an EAR with a custom descriptor location (generatedDescriptorLocation setting) * project-044: builds an EAR with a custom library-directory * project-045: builds an EAR and filter the content of the sources directory * project-046: builds an EAR and filter the content of the sources directory using a custom filter file * project-047: builds an EAR and filter the content with a list of extensions * project-048: builds an EAR with a Jboss 5 configuration containing library directory * project-049: builds an EAR with a Jboss 4.2 configuration containing a library directory * project-050: builds an EAR with a Jboss 5 configuration containing a loader repository configuration definition * project-051: builds an EAR with a Jboss 5 configuration containing a loader repository class definition * project-052: builds an EAR with a Jboss 5 configuration containing a configuration parser class definition * project-053: builds an EAR with a Jboss 5 configuration containing only the loader repo configuration * project-054: builds an EAR with deployment descriptor configuration for Java EE 5 and no application.xml * project-055: builds an EAR with jar dependencies added in application.xml maven-ear-plugin-2.3.2/src/site/apt/examples/0000755000175000017500000000000011241314103020746 5ustar twernertwernermaven-ear-plugin-2.3.2/src/site/apt/examples/customize-file-name-mapping.apt0000644000175000017500000000265411014060171026772 0ustar twernertwerner ------ Customizing The File Name Mapping ------ Stephane Nicoll ------ November 19, 2006 ~~ 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 Customizing The File Name Mapping It might happen that your project has the same artifactId for different groups. To avoid file name clashing, specify the <<>> file name mapping. +-------- org.apache.maven.plugins maven-ear-plugin [...] full +--------- As a result, each artifact file name will be prefixed by the groupId to avoid clashes. maven-ear-plugin-2.3.2/src/site/apt/examples/customizing-context-root.apt0000644000175000017500000000274611014060171026504 0ustar twernertwerner ------ Customizing The Context Root ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Customizing The Context Root The sample below shows how to customize the context root of an artifact to be placed in the EAR file: +-------- org.apache.maven.plugins maven-ear-plugin [...] artifactGroupId artifactId /custom-context-root +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/excluding-a-module.apt0000644000175000017500000000274411014060171025147 0ustar twernertwerner ------ Excluding A Module ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Excluding A Module If for some reason a dependency which is declared in the pom of the project needs to be excluded, the excluded flag could be used as follows: +-------- org.apache.maven.plugins maven-ear-plugin [...] artifactGroupId artifactId true +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/customizing-module-uri.apt0000644000175000017500000000304211014060171026107 0ustar twernertwerner ------ Customizing A Module URI ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Customizing A Module URI This is actually a combination of customizing the module's location and file name. The sample below shows how to specify the URI of a module being placed in the EAR file: +-------- org.apache.maven.plugins maven-ear-plugin [...] artifactGroupId artifactId APP-INF/lib/anotherName-1.2.3.jar +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/customizing-a-module-filename.apt0000644000175000017500000000272411014060171027314 0ustar twernertwerner ------ Customizing A Module Filename ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Customizing A Module Filename The example below shows how to rename a module being placed in the EAR file: +-------- org.apache.maven.plugins maven-ear-plugin [...] artifactGroupId artifactId anotherName-1.2.3.jar +--------- ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-ear-plugin-2.3.2/src/site/apt/examples/specifying-security-roles-for-the-generated-application-xml.aptmaven-ear-plugin-2.3.2/src/site/apt/examples/specifying-security-roles-for-the-generated-application0000644000175000017500000000313311014060171033620 0ustar twernertwerner ------ Specifying Security Roles For The Generated application.xml ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Security Roles For The Generated application.xml Security roles might be specified as follows +-------- org.apache.maven.plugins maven-ear-plugin [...] manager My cool description teller +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/customizing-module-location.apt0000644000175000017500000000462611014060171027131 0ustar twernertwerner ------ Customizing A Module Location ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Customizing A Module Location The example below shows how to place a library in the APP-INF/lib directory of the EAR file: +-------- org.apache.maven.plugins maven-ear-plugin [...] artifactGroupId artifactId APP-INF/lib +--------- Note that it is possible to specify a default bundle directory for all libraries. If a Jar module has not the bundleDir property above, the default one is used. Below is an example of such configuration: +-------- org.apache.maven.plugins maven-ear-plugin [...] APP-INF/lib artifactGroupId artifactId / +--------- In the above case, jar modules (i.e. libraries) will be placed in the APP-INF/lib directory except the specified artifact which will be placed at the root of the EAR structure. maven-ear-plugin-2.3.2/src/site/apt/examples/filtering-advanced.apt0000644000175000017500000000566511136720503025226 0ustar twernertwerner ------ Filtering Advanced Techniques ------ Stephane Nicoll ------ January 3, 2009 ~~ 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 Filtering: Advanced techniques The following features are described in this document: * Escaping properties that should not be filtered * Ignoring files based on its extension * Escaping properties It may be necessary to filters some properties in a file and ignore another. The filtering mechanism won't touch a token that is not recognized (i.e. that represents an unknown property). This won't work if the property is known obviously so it should be escaped explicitely. The following configuration defines the value of the <<>> which will stop the interpolation of a property if it starts with that value +-------- org.apache.maven.plugins maven-ear-plugin true \ [...] +--------- Assuming the following file +-------- jdbc.url=${db.url} jdbc.user=${db.username} jdbc.password=\${db.password} +-------- Filtering the content of such a file with this config will produce this content. Note that that the escaped property can now be filtered the usual way later if necessary! +-------- jdbc.url=jdbc:oracle:thin:@localhost:1521:orcl jdbc.user=someuser jdbc.password=${db.password} +-------- * Ignoring files based on its extension Filtering binary files corrupt them so it may be necessary to exclude files from filtering based on the extension. To do so, configure the plugin as follow +-------- org.apache.maven.plugins maven-ear-plugin true png jpeg [...] +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/generating-jboss-app.apt0000644000175000017500000000313411014060171025475 0ustar twernertwerner ------ Generating the JBoss deployment descriptor file ------ Stephane Nicoll ------ August 06, 2006 ~~ 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 Generating the JBoss deployment descriptor file To trigger the generation of the jboss-app.xml file you need to configure the 'jboss' element. For instance to target version 4 of JBoss with a 'guest' unauthenticated principal and a scoped classloader: +-------- org.apache.maven.plugins maven-ear-plugin [...] 4 guest com.foo:loader=foo-application-1.0.ear +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/filtering-sources.apt0000644000175000017500000000371411136720503025135 0ustar twernertwerner ------ Filtering the sources ------ Stephane Nicoll ------ January 3, 2009 ~~ 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 Filtering the sources Filtering the content of the <<>> directory or the one defined by the <<>> parameter is as easy as: +-------- org.apache.maven.plugins maven-ear-plugin true [...] +--------- Note that the standard properties are available for filtering. It is also possible to specify a set of property files to add extra values if necessary. The configuration below uses also the properties defined in <<>> +-------- org.apache.maven.plugins maven-ear-plugin true src/main/filters/config.properties [...] +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/including-a-third-party-library-in-application-xml.apt0000644000175000017500000000323511014060171033264 0ustar twernertwerner ------ Including A Third Party Library In application.xml ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Including A Third Party Library In application.xml If third party libraries need to be included in the generated application.xml, the 'includeInApplicationXml' flag could be used. This flag works only for jar modules since they define third party libraries packaged within the EAR. +-------- org.apache.maven.plugins maven-ear-plugin [...] artifactGroupId artifactId true +--------- maven-ear-plugin-2.3.2/src/site/apt/examples/unpacking-a-module.apt0000644000175000017500000000363211014060171025141 0ustar twernertwerner ------ Unpacking A Module ------ Stephane Nicoll ------ Augustus 14, 2006 ~~ 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 Unpacking A Module If you need to unpack artifacts in the generted EAR, you can configure it in two ways: * Specify the unpack attribute on the required artifact(s) * Specify the comma separated list of types to unpack by default Note that artifacts are unpacked according to their respective URI. +-------- org.apache.maven.plugins maven-ear-plugin artifactGroupId artifactId true +--------- +-------- org.apache.maven.plugins maven-ear-plugin rar,war,ejb [...] +--------- maven-ear-plugin-2.3.2/src/site/apt/usage.apt0000644000175000017500000001462411150266035020762 0ustar twernertwerner ------ Configuration and Usage ------ Stephane Nicoll ------ September 23, 2005 ~~ 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 Configuration and Usage * Introduction The EAR plugin allows to generate automatically the descriptor deployment, e.g. application.xml. This generation is already customized by the goal's parameters, see {{{plugin-info.html}the goals description}}. * Configuring the EAR Plugin The configuration of the EAR Plugin is not any different with the configuration of the other plugins. The configuration should be similar to: +----- [...] [...] [...] maven-ear-plugin [...] +----- When configuring the EAR Plugin in your pom.xml, you do not declare any \ elements in it because it is always invoked at least once during the package phase of an <<>> project. * Executing and Generating your EAR Package The EAR Plugin replaces the Jar Plugin when your project \ is <<>>. So to generate your EAR package, you need only call the package phase like so: +----- mvn package +----- * Copying resources The default resource directory for an EAR is <<>> as defined by the <<>> parameter. The content of this directory may be filterd if necessary using the <<>> parameter. For more details, have a look to the examples. * Advanced Configuration Any EAR module might be further customized as follows: * <>: the directory in the EAR structure where the artifact will be stored. * <>: the name of the artifact in the EAR structure. * <>: the complete path in the EAR structure for the artifact. * <>: excludes the artifact from the generated ear. * <>: unpack the artifact in the generated ear. The context root of a Web module might be customized using the contextRoot parameter. Please note that third party libraries (i.e. JarModule) are not included in the generated application.xml (only ejb-client should be included in a entry). However, a jar dependency could be included in the generated application.xml by specifying the <<>> flag. It is also possible to specify a default bundle directory for all third party libraries by specifying the <<>> parameter. The security settings might be specified under the security parameter. The artifact's types that should be unpacked by default can be specified using the unpackTypes parameter The file name mapping to use for artifacts stored in the EAR can be specified using the <<>> parameter. Valid values for this parameter are <<>> (default) and <<>>. By specifying <<>> as file name mapping, artifacts are prefixed by the <<>> where dots have been replaced by dashes. For more information on EAR modules, please see the {{{modules.html}modules configuration}} page. You can take a look at the examples for more information on these advanced configurations. * JBoss support The EAR plugin can generate the jboss-app.xml automatically. To do so, the 'jboss' element must be configured and takes the following child elements: * <>: the targeted JBoss version to use, 3.2, 4, 4.2 or 5 (the default is 4). * <>: the directory where libraries can be found in the ear (JBoss 4.2+ only) * <>: the JNDI name of the security manager (JBoss 4+ only) * <>: the unauthenticated principal (JBoss 4+ only) * <>: the name of the UnifiedLoaderRepository MBean to use for the ear to provide ear level scoping of classes deployed in the ear. It can have a <> attribute that defines the class loader repository class to use * <>: the class loader repository configuration. If no <> element is defined, a default one is added. It can have a <> attribute that defines the class loader's configuration parser class to use. The pom snippet below fully configures the following loader repository +----- dot.com:loader=unique-archive-name java2ParentDelegation=true +----- +----- [...] dot.com:loader=unique-archive-name java2ParentDelegation=true +----- * <>: the object name of the ear mbean. * <>: specify the order in which the modules specified in the application.xml file gets loaded (JBoss 4.2 only) * <>: specify the desired data source(s) to add into the jboss-app.xml, usage is as follows: +----- [...] main-ds.xml config/secondary-ds.xml [...] +----- Hibernate archives (HAR) and Service archives (SAR) will be recognized automatically and added the the jboss-app.xml file. You can take a look at the examples for more information on the JBoss support. maven-ear-plugin-2.3.2/src/site/apt/modules.apt0000644000175000017500000003401311152525671021326 0ustar twernertwerner ------ EAR Modules ------ Edwin Punzalan ------ 31 July 2006 ------ ~~ 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 EAR Modules The EAR Plugin supports additional configurations of the following modules: * {{{#ejbClientModule}ejbClientModule}} * {{{#ejbModule}ejbModule}} * {{{#ejbModule}ejb3Module}} (deprecated. ejbModule provides the same functionality) * {{{#jarModule}jarModule}} (previously know as javaModule and deprecated) * {{{#parModule}parModule}} * {{{#rarModule}rarModule}} * {{{#sarModule}sarModule}} * {{{#webModule}webModule}} * {{{#wsrModule}wsrModule}} * {{{#harModule}harModule}} [] If the artifact you want to configure is not listed above, you can create your own custom artifact configuration by following the {{{#Custom Artifact Types}adding custom artifact types}} guide below this page. These module names go into the <<>> parameter of the EAR Plugin. For example, to configure the properties of an EjbModule, the EAR Plugin configuration for <<>> would look like: +----- [...] [...] [...] maven-ear-plugin [...] +----- * {ejbClientModule} Properties The following configuration options are available for EjbClientModule: * <> - sets the groupId of the ejb-client artifact you want to configure. * <> - sets the artifactId of the ejb-client artifact you want to configure. * <> - sets the classifier of the ejb-client artifact you want to configure if multiple ejb-client artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the URI path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * <> - sets the alternative deployment descriptor for this module. * {ejbModule} Properties The following configuration options are available for EjbModule: * <> - sets the groupId of the ejb artifact you want to configure. * <> - sets the artifactId of the ejb artifact you want to configure. * <> - sets the classifier of the ejb artifact you want to configure if multiple ejb artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * <> - sets the alternative deployment descriptor for this module. * {jarModule} Properties The following configuration options are available for JarModule: * <> - sets the groupId of the jar artifact you want to configure. * <> - sets the artifactId of the jar artifact you want to configure. * <> - sets the classifier of the jar artifact you want to configure if multiple jar artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * <> - sets the alternative deployment descriptor for this module. * <> - set to true to if you want to generate an entry of this module in <<>>. Default is false. * {parModule} Properties The following configuration options are available for ParModule: * <> - sets the groupId of the par artifact you want to configure. * <> - sets the artifactId of the par artifact you want to configure. * <> - sets the classifier of the par artifact you want to configure if multiple par artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * <> - sets the alternative deployment descriptor for this module. * {rarModule} Properties The following configuration options are available for RarModule: * <> - sets the groupId of the rar artifact you want to configure. * <> - sets the artifactId of the rar artifact you want to configure. * <> - sets the classifier of the rar artifact you want to configure if multiple rar artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * <> - sets the alternative deployment descriptor for this module. * {sarModule} Properties The following configuration options are available for SarModule: * <> - sets the groupId of the sar artifact you want to configure. * <> - sets the artifactId of the sar artifact you want to configure. * <> - sets the classifier of the sar artifact you want to configure if multiple sar artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * {webModule} Properties The following configuration options are available for WebModule: * <> - sets the groupId of the web artifact you want to configure. * <> - sets the artifactId of the web artifact you want to configure. * <> - sets the classifier of the web artifact you want to configure if multiple web artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * <> - sets the alternative deployment descriptor for this module. * <> - sets the context root of this web artifact. * {wsrModule} Properties The following configuration options are available for WsrModule: * <> - sets the groupId of the wsr artifact you want to configure. * <> - sets the artifactId of the wsr artifact you want to configure. * <> - sets the classifier of the wst artifact you want to configure if multiple wsr artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * <> - sets the alternative deployment descriptor for this module. * {harModule} Properties The following configuration options are available for HarModule: * <> - sets the groupId of the hibernate archive artifact you want to configure. * <> - sets the artifactId of the hibernate archive artifact you want to configure. * <> - sets the classifier of the hibernate archive artifact you want to configure if multiple hibernate archive artifacts matches the groupId/artifact. Use the mainArtifactId ('none' by default) to define the main artifact (e.g. the artifact without a classifier) * <> - sets the location of this artifact inside the ear archive. If not set, this artifact will be packaged in the root of the archive. * <> - sets the new name of this artifact inside the ear archive. If not set, the artifact's filename in the repository is used. * <> - set to true to exclude this artifact from being packaged into the ear archive. Default is false. * <> - sets the uri path of this artifact within the ear archive. Automatically determined when not set. * <> - set to true to unpack this artifact into the ear archive according to its uri. Default is false. * Adding {Custom Artifact Types} If you need to map a custom artifact type to one of those types, use the <<>>. For instance, to map a custom 'my-rar' to the 'rar' standard artifact's type, add the following to the pom's configuration: +-------- org.apache.maven.plugins maven-ear-plugin +--------- maven-ear-plugin-2.3.2/src/site/apt/index.apt0000644000175000017500000001030211127632146020756 0ustar twernertwerner ------ Introduction ------ Edwin Punzalan Stephane Nicoll ------ 27 July 2006 ------ ~~ 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 Maven EAR Plugin This plugin generates J2EE Enterprise Archive (EAR) file. It can also generate the deployment descriptor file (e.g. application.xml). The EAR plugin supports the following artifacts: * ejb * war * jar * ejb-client * rar * ejb3 * par * sar * wsr * har [] For available configuration options for these artifacts, please see the {{{modules.html}modules configuration}}. For more information about the J2EE technology, please visit {{http://java.sun.com/developer/technicalArticles/J2EE/Intro}}. * Goals Overview EAR Plugin has two goals: * {{{ear-mojo.html}ear:ear}} generates J2EE Enterprise Archive (EAR) files. * {{{generate-application-xml-mojo.html}ear:generate-application-xml}} generates the deployment descriptor file(s). * Usage General instructions on how to use the EAR Plugin can be found on the {{{usage.html}usage page}}. Some more specific use cases are described in the examples given below. Further real-life examples are given in the plugin's {{{tests.html}test suite}}. Last but not least, users occasionally contribute additional examples, tips or errata to the {{{http://docs.codehaus.org/display/MAVENUSER/EAR+Plugin}plugin's wiki page}}. In case you still have questions regarding the plugin's usage, please have a look at the {{{faq.html}FAQ}} and feel free to contact the {{{mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our {{{issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{source-repository.html}source repository}} and will find supplementary information in the {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. * Examples To provide you with better understanding on some usages of the EAR Plugin, you can take a look into the following examples: * {{{examples/filtering-sources.html}Filtering EAR Resources}} * {{{examples/filtering-advanced.html}Advanced Filtering Techniques}} * {{{examples/customizing-a-module-filename.html}Customizing A Module Filename}} * {{{examples/customizing-context-root.html}Customizing The Context Root}} * {{{examples/customizing-module-location.html}Customizing A Module Location}} * {{{examples/customizing-module-uri.html}Customizing A Module URI}} * {{{examples/excluding-a-module.html}Excluding A Module}} * {{{examples/unpacking-a-module.html}Unpacking A Module}} * {{{examples/including-a-third-party-library-in-application-xml.html} Including A Third Party Library In application.xml}} * {{{examples/specifying-security-roles-for-the-generated-application-xml.html} Specifying Security Roles For The Generated application.xml}} * {{{examples/generating-jboss-app.html} Generating the jboss-app.xml file}} maven-ear-plugin-2.3.2/src/test/0000755000175000017500000000000011241314101016355 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/0000755000175000017500000000000011241314101020367 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/0000755000175000017500000000000011241314102022221 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-025/0000755000175000017500000000000011241314102024173 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-025/expected-META-INF/0000755000175000017500000000000011241314102027132 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-025/expected-META-INF/application.xml0000644000175000017500000000222010537340337032173 0ustar twernertwerner maven-ear-plugin-test-project-025 ejb-sample-one-1.0-classified.jar ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-025/pom.xml0000644000175000017500000000422411136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-025 99.0 Maven ear eartest ejb-sample-one 1.0 ejb classified eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-one classified true maven-ear-plugin-2.3.2/src/test/resources/projects/project-048/0000755000175000017500000000000011241314102024200 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-048/expected-META-INF/0000755000175000017500000000000011241314102027137 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-048/expected-META-INF/jboss-app.xml0000644000175000017500000000176611150216622031600 0ustar twernertwerner /APP-INF/lib maven-ear-plugin-2.3.2/src/test/resources/projects/project-048/expected-META-INF/application.xml0000644000175000017500000000220511150216622032172 0ustar twernertwerner maven-ear-plugin-test-project-048 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-048/pom.xml0000644000175000017500000000372511150216622025533 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-048 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 5 /APP-INF/lib maven-ear-plugin-2.3.2/src/test/resources/projects/project-006/0000755000175000017500000000000011241314102024172 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-006/expected-META-INF/0000755000175000017500000000000011241314102027131 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-006/expected-META-INF/application.xml0000644000175000017500000000211010537340337032170 0ustar twernertwerner maven-ear-plugin-test-project-006 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-006/pom.xml0000644000175000017500000000425011136722153025524 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-006 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest jar-sample-one 1.0 eartest jar-sample-two 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ eartest jar-sample-one true maven-ear-plugin-2.3.2/src/test/resources/projects/project-007/0000755000175000017500000000000011241314102024173 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-007/expected-META-INF/0000755000175000017500000000000011241314102027132 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-007/expected-META-INF/application.xml0000644000175000017500000000212310537340337032175 0ustar twernertwerner maven-ear-plugin-test-project-007 ejb-sample-one-1.0-classified.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-007/pom.xml0000644000175000017500000000323311136722153025525 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-007 99.0 Maven ear eartest ejb-sample-one classified 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-020/0000755000175000017500000000000011241314102024166 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-020/expected-META-INF/0000755000175000017500000000000011241314102027125 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-020/expected-META-INF/application.xml0000644000175000017500000000222110537340337032167 0ustar twernertwerner maven-ear-plugin-test-project-020 ejb-sample-one-1.0.jar sar-sample-one-1.0.sar maven-ear-plugin-2.3.2/src/test/resources/projects/project-020/pom.xml0000644000175000017500000000427311136722153025525 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-020 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest sar-sample-one 1.0 sar eartest jar-sample-one 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-one true maven-ear-plugin-2.3.2/src/test/resources/projects/project-030/0000755000175000017500000000000011241314102024167 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-030/expected-META-INF/0000755000175000017500000000000011241314102027126 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-030/expected-META-INF/application.xml0000644000175000017500000000211110547001407032157 0ustar twernertwerner maven-ear-plugin-test-project-030 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-030/pom.xml0000644000175000017500000000344511136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-030 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb-client org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-018/0000755000175000017500000000000011241314102024175 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-018/pom.xml0000644000175000017500000000333111136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-018 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ my-custom-file maven-ear-plugin-2.3.2/src/test/resources/projects/project-050/0000755000175000017500000000000011241314102024171 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-050/expected-META-INF/0000755000175000017500000000000011241314102027130 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-050/expected-META-INF/jboss-app.xml0000644000175000017500000000205011150216622031554 0ustar twernertwerner abcdef maven-ear-plugin-2.3.2/src/test/resources/projects/project-050/expected-META-INF/application.xml0000644000175000017500000000220511150216622032163 0ustar twernertwerner maven-ear-plugin-test-project-050 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-050/pom.xml0000644000175000017500000000402111150216622025512 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-050 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 5 abc def maven-ear-plugin-2.3.2/src/test/resources/projects/project-034/0000755000175000017500000000000011241314102024173 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-034/expected-META-INF/0000755000175000017500000000000011241314102027132 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-034/expected-META-INF/application.xml0000644000175000017500000000260611045660730032200 0ustar twernertwerner maven-ear-plugin-test-project-034 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar manager My cool description teller maven-ear-plugin-2.3.2/src/test/resources/projects/project-034/pom.xml0000644000175000017500000000430111136722153025522 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-034 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ manager My cool description teller maven-ear-plugin-2.3.2/src/test/resources/projects/project-044/0000755000175000017500000000000011241314102024174 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-044/expected-META-INF/0000755000175000017500000000000011241314102027133 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-044/expected-META-INF/application.xml0000644000175000017500000000230711136720503032173 0ustar twernertwerner maven-ear-plugin-test-project-044 ejb-sample-one-1.0.jar myLibs maven-ear-plugin-2.3.2/src/test/resources/projects/project-044/pom.xml0000644000175000017500000000363411136722153025533 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-044 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest jar-sample-one 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ 5 myLibs maven-ear-plugin-2.3.2/src/test/resources/projects/project-013/0000755000175000017500000000000011241314102024170 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-013/src/0000755000175000017500000000000011241314102024757 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-013/src/main/0000755000175000017500000000000011241314102025703 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-013/src/main/ear/0000755000175000017500000000000011241314102026452 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-013/src/main/ear/LICENSE.txt0000644000175000017500000000001410522155300030274 0ustar twernertwernerfake licensemaven-ear-plugin-2.3.2/src/test/resources/projects/project-013/src/main/ear/README.txt0000644000175000017500000000001310522155300030146 0ustar twernertwernerfake readmemaven-ear-plugin-2.3.2/src/test/resources/projects/project-013/expected-META-INF/0000755000175000017500000000000011241314102027127 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-013/expected-META-INF/application.xml0000644000175000017500000000211010537340337032166 0ustar twernertwerner maven-ear-plugin-test-project-013 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-013/pom.xml0000644000175000017500000000335211136722153025524 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-013 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ src/main/ear maven-ear-plugin-2.3.2/src/test/resources/projects/project-045/0000755000175000017500000000000011241314102024175 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-045/src/0000755000175000017500000000000011241314102024764 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-045/src/main/0000755000175000017500000000000011241314102025710 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-045/src/main/application/0000755000175000017500000000000011241314102030213 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-045/src/main/application/README.txt0000644000175000017500000000024311136720503031721 0ustar twernertwerner##### # # ${application.name} ${project.version} # ##### Bla bla bla bla bla. This property will not be filtered \${application.name}. Enjoy! --The Maven teammaven-ear-plugin-2.3.2/src/test/resources/projects/project-045/expected-META-INF/0000755000175000017500000000000011241314102027134 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-045/expected-META-INF/application.xml0000644000175000017500000000211011136720503032164 0ustar twernertwerner maven-ear-plugin-test-project-045 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-045/pom.xml0000644000175000017500000000350211136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-045 99.0 Maven ear my-app eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ true \ maven-ear-plugin-2.3.2/src/test/resources/projects/project-022/0000755000175000017500000000000011241314102024170 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-022/pom.xml0000644000175000017500000000333111136722153025521 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-022 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ myclassifier maven-ear-plugin-2.3.2/src/test/resources/projects/project-008/0000755000175000017500000000000011241314102024174 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-008/expected-META-INF/0000755000175000017500000000000011241314102027133 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-008/expected-META-INF/application.xml0000644000175000017500000000232410537340337032201 0ustar twernertwerner Sample test application #008 The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-008/pom.xml0000644000175000017500000000373311136722153025533 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-008 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ Sample test application #008 The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. ISO-8859-15 1.3 maven-ear-plugin-2.3.2/src/test/resources/projects/project-047/0000755000175000017500000000000011241314102024177 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-047/src/0000755000175000017500000000000011241314102024766 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-047/src/main/0000755000175000017500000000000011241314102025712 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-047/src/main/application/0000755000175000017500000000000011241314102030215 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-047/src/main/application/README.txt0000644000175000017500000000015111136720503031721 0ustar twernertwerner##### # # ${application.name} ${project.version} # ##### Bla bla bla bla bla. Enjoy! --The Maven teammaven-ear-plugin-2.3.2/src/test/resources/projects/project-047/expected-META-INF/0000755000175000017500000000000011241314102027136 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-047/expected-META-INF/application.xml0000644000175000017500000000211011136720503032166 0ustar twernertwerner maven-ear-plugin-test-project-047 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-047/pom.xml0000644000175000017500000000365311136722153025537 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-047 99.0 Maven ear my-app eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ true txt maven-ear-plugin-2.3.2/src/test/resources/projects/project-052/0000755000175000017500000000000011241314102024173 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-052/expected-META-INF/0000755000175000017500000000000011241314102027132 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-052/expected-META-INF/jboss-app.xml0000644000175000017500000000213411150216622031561 0ustar twernertwerner abcghi maven-ear-plugin-2.3.2/src/test/resources/projects/project-052/expected-META-INF/application.xml0000644000175000017500000000220511150216622032165 0ustar twernertwerner maven-ear-plugin-test-project-052 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-052/pom.xml0000644000175000017500000000411711150266035025525 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-052 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 5 abc ghi maven-ear-plugin-2.3.2/src/test/resources/projects/project-033/0000755000175000017500000000000011241314102024172 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-033/expected-META-INF/0000755000175000017500000000000011241314102027131 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-033/expected-META-INF/jboss-app.xml0000644000175000017500000000207111045660730031566 0ustar twernertwerner sar-sample-one-1.0.sar har-sample-one-1.0.har maven-ear-plugin-2.3.2/src/test/resources/projects/project-033/expected-META-INF/application.xml0000644000175000017500000000220511045660730032172 0ustar twernertwerner maven-ear-plugin-test-project-033 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-033/pom.xml0000644000175000017500000000435511136722153025532 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-033 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb eartest sar-sample-one 1.0 sar eartest har-sample-one 1.0 har org.apache.maven.plugins maven-ear-plugin @project.version@ 4 maven-ear-plugin-2.3.2/src/test/resources/projects/project-036/0000755000175000017500000000000011241314102024175 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-036/expected-META-INF/0000755000175000017500000000000011241314102027134 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-036/expected-META-INF/application.xml0000644000175000017500000000256011045660730032201 0ustar twernertwerner maven-ear-plugin-test-project-036 sar-sample-one.sar foo/eartest-ejb-sample-one-1.0.jar eartest-ejb-sample-two-1.0.jar com-foo-bar-ejb-sample-one-1.0.jar com-foo-bar-ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-036/pom.xml0000644000175000017500000000626511136722153025537 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-036 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb com.foo.bar ejb-sample-one 1.0 ejb com.foo.bar ejb-sample-two 1.0 ejb eartest jar-sample-one 1.0 jar eartest jar-sample-two 1.0 jar eartest sar-sample-one 1.0 sar org.apache.maven.plugins maven-ear-plugin @project.version@ full libs eartest sar-sample-one sar-sample-one.sar eartest ejb-sample-one foo maven-ear-plugin-2.3.2/src/test/resources/projects/project-039/0000755000175000017500000000000011241314102024200 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-039/expected-META-INF/0000755000175000017500000000000011241314102027137 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-039/expected-META-INF/jboss-app.xml0000644000175000017500000000200710772002170031565 0ustar twernertwerner com.foo:loader=foo-application-1.0.ear maven-ear-plugin-2.3.2/src/test/resources/projects/project-039/expected-META-INF/application.xml0000644000175000017500000000220511045660730032200 0ustar twernertwerner maven-ear-plugin-test-project-039 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-039/pom.xml0000644000175000017500000000375711136722153025545 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-039 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 4 com.foo:loader=foo-application-1.0.ear maven-ear-plugin-2.3.2/src/test/resources/projects/project-017/0000755000175000017500000000000011241314102024174 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-017/src/0000755000175000017500000000000011241314102024763 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-017/src/main/0000755000175000017500000000000011241314102025707 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-017/src/main/ear/0000755000175000017500000000000011241314102026456 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-017/src/main/ear/application.xml0000644000175000017500000000215510537340337031526 0ustar twernertwerner My custom display name Custom description ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-017/expected-META-INF/0000755000175000017500000000000011241314102027133 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-017/expected-META-INF/application.xml0000644000175000017500000000215510537340337032203 0ustar twernertwerner My custom display name Custom description ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-017/pom.xml0000644000175000017500000000336111136722153025530 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-017 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ src/main/ear/application.xml maven-ear-plugin-2.3.2/src/test/resources/projects/project-032/0000755000175000017500000000000011241314102024171 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-032/expected-META-INF/0000755000175000017500000000000011241314102027130 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-032/expected-META-INF/jboss-app.xml0000644000175000017500000000175010537340337031573 0ustar twernertwerner FOO:service=MyApplication maven-ear-plugin-2.3.2/src/test/resources/projects/project-032/expected-META-INF/application.xml0000644000175000017500000000220511045660730032171 0ustar twernertwerner maven-ear-plugin-test-project-032 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-032/pom.xml0000644000175000017500000000372211136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-032 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 3.2 FOO:service=MyApplication maven-ear-plugin-2.3.2/src/test/resources/projects/project-016/0000755000175000017500000000000011241314102024173 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-016/src/0000755000175000017500000000000011241314102024762 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-016/src/main/0000755000175000017500000000000011241314102025706 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-016/src/main/ear/0000755000175000017500000000000011241314102026455 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-016/src/main/ear/MANIFEST.MF0000644000175000017500000000015210522155300030111 0ustar twernertwernerManifest-Version: 1.0 Archiver-Version: Custom Archive Created-By: Foo Built-By: sni Build-Jdk: 1.5.0_06 maven-ear-plugin-2.3.2/src/test/resources/projects/project-016/expected-META-INF/0000755000175000017500000000000011241314102027132 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-016/expected-META-INF/application.xml0000644000175000017500000000211010537340337032171 0ustar twernertwerner maven-ear-plugin-test-project-016 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-016/pom.xml0000644000175000017500000000335111136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-016 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ src/main/ear/MANIFEST.MF maven-ear-plugin-2.3.2/src/test/resources/projects/project-011/0000755000175000017500000000000011241314102024166 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-011/expected-META-INF/0000755000175000017500000000000011241314102027125 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-011/expected-META-INF/application.xml0000644000175000017500000000211010537340337032164 0ustar twernertwerner maven-ear-plugin-test-project-011 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-011/pom.xml0000644000175000017500000000316111136722153025520 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-011 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-005/0000755000175000017500000000000011241314102024171 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-005/expected-META-INF/0000755000175000017500000000000011241314102027130 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-005/expected-META-INF/application.xml0000644000175000017500000000211010537340337032167 0ustar twernertwerner maven-ear-plugin-test-project-005 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-005/pom.xml0000644000175000017500000000414111136722153025522 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-005 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest jar-sample-one 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ APP-INF/lib eartest jar-sample-one libs/another-name.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-002/0000755000175000017500000000000011241314102024166 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-002/expected-META-INF/0000755000175000017500000000000011241314102027125 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-002/expected-META-INF/application.xml0000644000175000017500000000221510537340337032172 0ustar twernertwerner maven-ear-plugin-test-project-002 APP-INF/lib/ejb-sample-one-1.0.jar ejb-sample-two.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-002/pom.xml0000644000175000017500000000440411136722153025521 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-002 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-one APP-INF/lib eartest ejb-sample-two ejb-sample-two.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-028/0000755000175000017500000000000011241314102024176 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-028/expected-META-INF/0000755000175000017500000000000011241314102027135 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-028/expected-META-INF/application.xml0000644000175000017500000000211010537340337032174 0ustar twernertwerner maven-ear-plugin-test-project-028 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-028/pom.xml0000644000175000017500000000346111136722153025533 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-028 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb test org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-038/0000755000175000017500000000000011241314102024177 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-038/expected-META-INF/0000755000175000017500000000000011241314102027136 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-038/expected-META-INF/application.xml0000644000175000017500000000062110772002170032171 0ustar twernertwerner maven-ear-plugin-test-project-038 ejb-sample-one-1.0.jar ejb-sample-one-1.0-classified.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-038/pom.xml0000644000175000017500000000421611136722153025533 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-038 99.0 Maven ear eartest ejb-sample-one 1.0 ejb classified eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-one none true maven-ear-plugin-2.3.2/src/test/resources/projects/project-056/0000755000175000017500000000000011241314102024177 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-056/expected-META-INF/0000755000175000017500000000000011241314102027136 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-056/expected-META-INF/application.xml0000644000175000017500000000230011152525671032176 0ustar twernertwerner maven-ear-plugin-test-project-056 ejb-sample-one-1.0.jar sample-one-ejb-jar.xml maven-ear-plugin-2.3.2/src/test/resources/projects/project-056/pom.xml0000644000175000017500000000401111152525671025530 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-056 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ UTF-8 1.4 eartest ejb-sample-one sample-one-ejb-jar.xml maven-ear-plugin-2.3.2/src/test/resources/projects/project-019/0000755000175000017500000000000011241314102024176 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-019/expected-META-INF/0000755000175000017500000000000011241314102027135 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-019/expected-META-INF/application.xml0000644000175000017500000000222110537340337032177 0ustar twernertwerner maven-ear-plugin-test-project-019 ejb-sample-one-1.0.jar sar-sample-one-1.0.sar maven-ear-plugin-2.3.2/src/test/resources/projects/project-019/pom.xml0000644000175000017500000000402211136722153025525 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-019 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest sar-sample-one 1.0 sar eartest jar-sample-one 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ jar,sar maven-ear-plugin-2.3.2/src/test/resources/projects/project-012/0000755000175000017500000000000011241314102024167 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-012/src/0000755000175000017500000000000011241314102024756 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-012/src/main/0000755000175000017500000000000011241314102025702 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-012/src/main/application/0000755000175000017500000000000011241314102030205 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-012/src/main/application/LICENSE.txt0000644000175000017500000000001410522155300032027 0ustar twernertwernerfake licensemaven-ear-plugin-2.3.2/src/test/resources/projects/project-012/src/main/application/README.txt0000644000175000017500000000001310522155300031701 0ustar twernertwernerfake readmemaven-ear-plugin-2.3.2/src/test/resources/projects/project-012/expected-META-INF/0000755000175000017500000000000011241314102027126 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-012/expected-META-INF/application.xml0000644000175000017500000000211010537340337032165 0ustar twernertwerner maven-ear-plugin-test-project-012 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-012/pom.xml0000644000175000017500000000316111136722153025521 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-012 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-035/0000755000175000017500000000000011241314102024174 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-035/expected-META-INF/0000755000175000017500000000000011241314102027133 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-035/expected-META-INF/application.xml0000644000175000017500000000233610537340337032204 0ustar twernertwerner maven-ear-plugin-test-project-035 sar-sample-one.sar foo/eartest-ejb-sample-one-1.0.jar eartest-ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-035/pom.xml0000644000175000017500000000554511136722153025536 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-035 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb eartest jar-sample-one 1.0 jar eartest jar-sample-two 1.0 jar eartest sar-sample-one 1.0 sar org.apache.maven.plugins maven-ear-plugin @project.version@ full libs eartest sar-sample-one sar-sample-one.sar eartest ejb-sample-one foo maven-ear-plugin-2.3.2/src/test/resources/projects/project-021/0000755000175000017500000000000011241314102024167 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-021/expected-META-INF/0000755000175000017500000000000011241314102027126 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-021/expected-META-INF/application.xml0000644000175000017500000000231610537340337032175 0ustar twernertwerner maven-ear-plugin-test-project-021 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar sar-sample-one-1.0.sar maven-ear-plugin-2.3.2/src/test/resources/projects/project-021/pom.xml0000644000175000017500000000533711136722153025530 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-021 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb eartest sar-sample-one 1.0 sar eartest jar-sample-one 1.0 eartest jar-sample-two 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ ejb,jar eartest ejb-sample-one false eartest jar-sample-one false maven-ear-plugin-2.3.2/src/test/resources/projects/project-055/0000755000175000017500000000000011241314102024176 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-055/expected-META-INF/0000755000175000017500000000000011241314102027135 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-055/expected-META-INF/application.xml0000644000175000017500000000073311150275561032203 0ustar twernertwerner maven-ear-plugin-test-project-055 jar-sample-three-with-deps-1.0.jar jar-sample-two-1.0.jar jar-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-055/pom.xml0000644000175000017500000000346711150275561025543 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-055 99.0 Maven ear eartest jar-sample-one 1.0 eartest jar-sample-three-with-deps 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ true maven-ear-plugin-2.3.2/src/test/resources/projects/project-042/0000755000175000017500000000000011241314102024172 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-042/expected-META-INF/0000755000175000017500000000000011241314102027131 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-042/expected-META-INF/jboss-app.xml0000644000175000017500000000175711127602776031607 0ustar twernertwerner my-ds.xml maven-ear-plugin-2.3.2/src/test/resources/projects/project-042/expected-META-INF/application.xml0000644000175000017500000000220511045660730032172 0ustar twernertwerner maven-ear-plugin-test-project-042 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-042/pom.xml0000644000175000017500000000400111136722153025516 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-042 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 4.2 my-ds.xml maven-ear-plugin-2.3.2/src/test/resources/projects/project-023/0000755000175000017500000000000011241314102024171 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-023/expected-META-INF/0000755000175000017500000000000011241314102027130 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-023/expected-META-INF/application.xml0000644000175000017500000000222010537340337032171 0ustar twernertwerner maven-ear-plugin-test-project-023 ejb-sample-one-1.0-classified.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-023/pom.xml0000644000175000017500000000414211136722153025523 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-023 99.0 Maven ear eartest ejb-sample-one 1.0 ejb classified eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-one true maven-ear-plugin-2.3.2/src/test/resources/projects/project-015/0000755000175000017500000000000011241314102024172 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-015/src/0000755000175000017500000000000011241314102024761 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-015/src/main/0000755000175000017500000000000011241314102025705 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-015/src/main/application/0000755000175000017500000000000011241314102030210 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-015/src/main/application/META-INF/0000755000175000017500000000000011241314102031350 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-ear-plugin-2.3.2/src/test/resources/projects/project-015/src/main/application/META-INF/MANIFEST.MFmaven-ear-plugin-2.3.2/src/test/resources/projects/project-015/src/main/application/META-INF/MANIFES0000644000175000017500000000015210522156355032372 0ustar twernertwernerManifest-Version: 1.0 Archiver-Version: Custom Archive Created-By: Foo Built-By: sni Build-Jdk: 1.5.0_06 maven-ear-plugin-2.3.2/src/test/resources/projects/project-015/expected-META-INF/0000755000175000017500000000000011241314102027131 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-015/expected-META-INF/application.xml0000644000175000017500000000211010537340337032170 0ustar twernertwerner maven-ear-plugin-test-project-015 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-015/pom.xml0000644000175000017500000000317211136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-015 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-049/0000755000175000017500000000000011241314102024201 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-049/expected-META-INF/0000755000175000017500000000000011241314102027140 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-049/expected-META-INF/jboss-app.xml0000644000175000017500000000175511150216622031577 0ustar twernertwerner /APP-INF/lib maven-ear-plugin-2.3.2/src/test/resources/projects/project-049/expected-META-INF/application.xml0000644000175000017500000000220511150216622032173 0ustar twernertwerner maven-ear-plugin-test-project-049 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-049/pom.xml0000644000175000017500000000372711150216622025536 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-049 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 4.2 /APP-INF/lib maven-ear-plugin-2.3.2/src/test/resources/projects/project-026/0000755000175000017500000000000011241314102024174 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-026/pom.xml0000644000175000017500000000414411136722153025530 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-026 99.0 Maven ear eartest ejb-sample-one 1.0 ejb classified eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-one true maven-ear-plugin-2.3.2/src/test/resources/projects/project-014/0000755000175000017500000000000011241314102024171 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/0000755000175000017500000000000011241314102024760 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/0000755000175000017500000000000011241314102025704 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/application/0000755000175000017500000000000011241314102030207 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/application/content/0000755000175000017500000000000011241314102031661 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/application/content/ignore.txtmaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/application/content/ignore.t0000644000175000017500000000000610522155300033331 0ustar twernertwernerignoremaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/application/ignore.txt0000644000175000017500000000000610522155300032233 0ustar twernertwernerignoremaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/application/LICENSE.txt0000644000175000017500000000001410522155300032031 0ustar twernertwernerfake licensemaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/src/main/application/README.txt0000644000175000017500000000001310522155300031703 0ustar twernertwernerfake readmemaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/expected-META-INF/0000755000175000017500000000000011241314102027130 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-014/expected-META-INF/application.xml0000644000175000017500000000211010537340337032167 0ustar twernertwerner maven-ear-plugin-test-project-014 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-014/pom.xml0000644000175000017500000000346611136722153025533 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-014 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ LICENSE.txt **/*README.txt, **/*ignore.txt maven-ear-plugin-2.3.2/src/test/resources/projects/project-001/0000755000175000017500000000000011241314102024165 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-001/expected-META-INF/0000755000175000017500000000000011241314102027124 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-001/expected-META-INF/application.xml0000644000175000017500000000211010537340337032163 0ustar twernertwerner maven-ear-plugin-test-project-001 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-001/pom.xml0000644000175000017500000000316311136722153025521 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-001 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-040/0000755000175000017500000000000011241314102024170 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-040/expected-META-INF/0000755000175000017500000000000011241314102027127 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-040/expected-META-INF/application.xml0000644000175000017500000000251110772002170032162 0ustar twernertwerner The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. Sample test application #008 ejb-sample-one-1.0.jar sample-one-ejb-jar.xml maven-ear-plugin-2.3.2/src/test/resources/projects/project-040/pom.xml0000644000175000017500000000435311136722153025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-040 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ Sample test application #008 The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. UTF-8 5 eartest ejb-sample-one sample-one-ejb-jar.xml maven-ear-plugin-2.3.2/src/test/resources/projects/project-046/0000755000175000017500000000000011241314102024176 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-046/src/0000755000175000017500000000000011241314102024765 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-046/src/main/0000755000175000017500000000000011241314102025711 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-046/src/main/filters/0000755000175000017500000000000011241314102027361 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-046/src/main/filters/config.properties0000644000175000017500000000025411136720503032756 0ustar twernertwernerapplication.build=2 # WARNING: settings specified in the pom takes precedence so # the properties below won't be used application.name=my-other-app application.version=1.0maven-ear-plugin-2.3.2/src/test/resources/projects/project-046/src/main/application/0000755000175000017500000000000011241314102030214 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-046/src/main/application/README.txt0000644000175000017500000000030211136720503031716 0ustar twernertwerner##### # # ${application.name} ${project.version} (Build ${application.build}) # ##### Bla bla bla bla bla. This property will not be filtered ${application.unknown}. Enjoy! --The Maven teammaven-ear-plugin-2.3.2/src/test/resources/projects/project-046/expected-META-INF/0000755000175000017500000000000011241314102027135 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-046/expected-META-INF/application.xml0000644000175000017500000000211011136720503032165 0ustar twernertwerner maven-ear-plugin-test-project-046 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-046/pom.xml0000644000175000017500000000360211136722153025530 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-046 99.0 Maven ear my-app eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ true src/main/filters/config.properties maven-ear-plugin-2.3.2/src/test/resources/projects/project-010/0000755000175000017500000000000011241314102024165 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-010/expected-META-INF/0000755000175000017500000000000011241314102027124 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-010/expected-META-INF/application.xml0000644000175000017500000000243510537340337032175 0ustar twernertwerner The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. Sample test application #008 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-010/pom.xml0000644000175000017500000000372311136722153025523 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-010 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ Sample test application #008 The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. UTF-8 5 maven-ear-plugin-2.3.2/src/test/resources/projects/project-027/0000755000175000017500000000000011241314102024175 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-027/expected-META-INF/0000755000175000017500000000000011241314102027134 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-027/expected-META-INF/application.xml0000644000175000017500000000211010537340337032173 0ustar twernertwerner maven-ear-plugin-test-project-027 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-027/pom.xml0000644000175000017500000000346511136722153025536 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-027 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb provided org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-009/0000755000175000017500000000000011241314102024175 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-009/expected-META-INF/0000755000175000017500000000000011241314102027134 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-009/expected-META-INF/application.xml0000644000175000017500000000244010537340337032201 0ustar twernertwerner The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. Sample test application #008 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-009/pom.xml0000644000175000017500000000373211136722153025533 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-009 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ Sample test application #008 The purpose of this application is to test the ApplicationXmlMojo execution with custom settings. ISO-8859-1 1.4 maven-ear-plugin-2.3.2/src/test/resources/projects/project-003/0000755000175000017500000000000011241314102024167 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-003/expected-META-INF/0000755000175000017500000000000011241314102027126 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-003/expected-META-INF/application.xml0000644000175000017500000000211010537340337032165 0ustar twernertwerner maven-ear-plugin-test-project-003 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-003/pom.xml0000644000175000017500000000400311136722153025515 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-003 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest jar-sample-one 1.0 eartest jar-sample-two 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ APP-INF/lib maven-ear-plugin-2.3.2/src/test/resources/projects/project-043/0000755000175000017500000000000011241314102024173 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-043/expected-META-INF/0000755000175000017500000000000011241314102027132 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-043/expected-META-INF/application.xml0000644000175000017500000000212411045660774032203 0ustar twernertwerner maven-ear-plugin-test-project-043 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-043/pom.xml0000644000175000017500000000346211136722153025531 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-043 99.0 Maven ear eartest ejb-sample-one 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ ${project.build.directory}/custom-descriptor-dir maven-ear-plugin-2.3.2/src/test/resources/projects/project-031/0000755000175000017500000000000011241314102024170 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-031/expected-META-INF/0000755000175000017500000000000011241314102027127 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-031/expected-META-INF/jboss-app.xml0000644000175000017500000000206210537340337031567 0ustar twernertwerner java:/MySecurityDomain guest maven-ear-plugin-2.3.2/src/test/resources/projects/project-031/expected-META-INF/application.xml0000644000175000017500000000220511045660730032170 0ustar twernertwerner maven-ear-plugin-test-project-031 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-031/pom.xml0000644000175000017500000000404411136722153025523 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-031 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 4 java:/MySecurityDomain guest maven-ear-plugin-2.3.2/src/test/resources/projects/project-054/0000755000175000017500000000000011241314102024175 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-054/pom.xml0000644000175000017500000000366211150275561025537 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-054 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 5 false maven-ear-plugin-2.3.2/src/test/resources/projects/project-024/0000755000175000017500000000000011241314102024172 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-024/expected-META-INF/0000755000175000017500000000000011241314102027131 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-024/expected-META-INF/application.xml0000644000175000017500000000222010537340337032172 0ustar twernertwerner maven-ear-plugin-test-project-024 ejb-sample-one-1.0-classified.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-024/pom.xml0000644000175000017500000000422411136722153025525 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-024 99.0 Maven ear eartest ejb-sample-one 1.0 ejb classified eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-one classified true maven-ear-plugin-2.3.2/src/test/resources/projects/project-037/0000755000175000017500000000000011241314102024176 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-037/expected-META-INF/0000755000175000017500000000000011241314102027135 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-037/expected-META-INF/application.xml0000644000175000017500000000221710772002170032173 0ustar twernertwerner maven-ear-plugin-test-project-037 ejb-sample-two-1.0-client.jar ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-037/pom.xml0000644000175000017500000000414111136722153025527 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-037 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb-client org.apache.maven.plugins maven-ear-plugin @project.version@ eartest ejb-sample-two true maven-ear-plugin-2.3.2/src/test/resources/projects/project-051/0000755000175000017500000000000011241314102024172 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-051/expected-META-INF/0000755000175000017500000000000011241314102027131 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-051/expected-META-INF/jboss-app.xml0000644000175000017500000000201111150216622031552 0ustar twernertwerner abc maven-ear-plugin-2.3.2/src/test/resources/projects/project-051/expected-META-INF/application.xml0000644000175000017500000000220511150216622032164 0ustar twernertwerner maven-ear-plugin-test-project-051 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-051/pom.xml0000644000175000017500000000375011150266035025526 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-051 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 5 abc maven-ear-plugin-2.3.2/src/test/resources/projects/project-004/0000755000175000017500000000000011241314102024170 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-004/expected-META-INF/0000755000175000017500000000000011241314102027127 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-004/expected-META-INF/application.xml0000644000175000017500000000211010537340337032166 0ustar twernertwerner maven-ear-plugin-test-project-004 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-004/pom.xml0000644000175000017500000000435011136722153025523 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-004 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest jar-sample-one 1.0 eartest jar-sample-two 1.0 org.apache.maven.plugins maven-ear-plugin @project.version@ APP-INF/lib eartest jar-sample-one / maven-ear-plugin-2.3.2/src/test/resources/projects/project-053/0000755000175000017500000000000011241314102024174 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-053/expected-META-INF/0000755000175000017500000000000011241314102027133 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-053/expected-META-INF/jboss-app.xml0000644000175000017500000000205211150216622031561 0ustar twernertwerner abc maven-ear-plugin-2.3.2/src/test/resources/projects/project-053/expected-META-INF/application.xml0000644000175000017500000000220511150216622032166 0ustar twernertwerner maven-ear-plugin-test-project-053 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-053/pom.xml0000644000175000017500000000373211150216622025525 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-053 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 5 abc maven-ear-plugin-2.3.2/src/test/resources/projects/project-029/0000755000175000017500000000000011241314102024177 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-029/lib/0000755000175000017500000000000011241314102024745 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-029/expected-META-INF/0000755000175000017500000000000011241314102027136 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-029/expected-META-INF/application.xml0000644000175000017500000000211010537340337032175 0ustar twernertwerner maven-ear-plugin-test-project-029 ejb-sample-one-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-029/pom.xml0000644000175000017500000000351711136722153025536 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-029 99.0 Maven ear eartest ejb-sample-one 1.0 ejb javax.sql jdbc-stdext 2.0 system ${basedir}/lib/rt.jar org.apache.maven.plugins maven-ear-plugin @project.version@ maven-ear-plugin-2.3.2/src/test/resources/projects/project-041/0000755000175000017500000000000011241314102024171 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-041/expected-META-INF/0000755000175000017500000000000011241314102027130 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/projects/project-041/expected-META-INF/jboss-app.xml0000644000175000017500000000174310772002170031564 0ustar twernertwerner strict maven-ear-plugin-2.3.2/src/test/resources/projects/project-041/expected-META-INF/application.xml0000644000175000017500000000220511045660730032171 0ustar twernertwerner maven-ear-plugin-test-project-041 ejb-sample-one-1.0.jar ejb-sample-two-1.0.jar maven-ear-plugin-2.3.2/src/test/resources/projects/project-041/pom.xml0000644000175000017500000000370711136722153025531 0ustar twernertwerner 4.0.0 ear maven-ear-plugin-test-project-041 99.0 Maven ear eartest ejb-sample-one 1.0 ejb eartest ejb-sample-two 1.0 ejb org.apache.maven.plugins maven-ear-plugin @project.version@ 4.2 strict maven-ear-plugin-2.3.2/src/test/resources/settings.xml0000644000175000017500000000306511136722153022772 0ustar twernertwerner test test apache.snapshots http://people.apache.org/repo/m2-snapshot-repository apache.snapshots http://people.apache.org/repo/m2-snapshot-repository maven-ear-plugin-2.3.2/src/test/resources/m2repo/0000755000175000017500000000000011241314101021573 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/0000755000175000017500000000000011241314101023242 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/sar-sample-one/0000755000175000017500000000000011241314101026065 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/sar-sample-one/1.0/0000755000175000017500000000000011241314101026363 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/sar-sample-one/1.0/sar-sample-one-1.0.pom0000644000175000017500000000201310537340337032234 0ustar twernertwerner 4.0.0 eartest sar-sample-one sar 1.0 verified maven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/sar-sample-one/1.0/sar-sample-one-1.0.sar0000644000175000017500000000044510514505463032233 0ustar twernertwernerPK˛ĄO5—×mŇ— sar-sample-one-1.0.pomu±Â0 Dwľ˘?ЦHŚVvVvÓ¸Q M˘Ří÷ŁV”ńŢÝé,C.éIŘSÓŔśMw*R´—®ďz0?LCľ¤%_ť%,B,`v feaÄAŞd,-ăś'jS$0K“‡ú˝Á|Ąšë¶wÖ Öø ,%<©ŕ†=Í?ÇW“ea[óa äŔl@‹ć_łNďxPK˛ĄO5—×mŇ—  sar-sample-one-1.0.pomPKDËmaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-one/0000755000175000017500000000000011241314101026054 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-one/1.0/0000755000175000017500000000000011241314101026352 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-one/1.0/jar-sample-one-1.0.pom0000644000175000017500000000201310537340337032212 0ustar twernertwerner 4.0.0 eartest jar-sample-one jar 1.0 verified maven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/har-sample-one/0000755000175000017500000000000011241314101026052 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/har-sample-one/1.0/0000755000175000017500000000000011241314101026350 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/har-sample-one/1.0/har-sample-one-1.0.har0000644000175000017500000000044510527624730032175 0ustar twernertwernerPK˛ĄO5—×mŇ— sar-sample-one-1.0.pomu±Â0 Dwľ˘?ЦHŚVvVvÓ¸Q M˘Ří÷ŁV”ńŢÝé,C.éIŘSÓŔśMw*R´—®ďz0?LCľ¤%_ť%,B,`v feaÄAŞd,-ăś'jS$0K“‡ú˝Á|Ąšë¶wÖ Öø ,%<©ŕ†=Í?ÇW“ea[óa äŔl@‹ć_łNďxPK˛ĄO5—×mŇ—  sar-sample-one-1.0.pomPKDËmaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/har-sample-one/1.0/har-sample-one-1.0.pom0000644000175000017500000000201310537340337032206 0ustar twernertwerner 4.0.0 eartest har-sample-one har 1.0 verified maven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/ejb-sample-one/0000755000175000017500000000000011241314101026040 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/ejb-sample-one/1.0/0000755000175000017500000000000011241314101026336 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/ejb-sample-one/1.0/ejb-sample-one-1.0.pom0000644000175000017500000000201310537340337032162 0ustar twernertwerner 4.0.0 eartest ejb-sample-one ejb 1.0 verified maven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-three-with-deps/0000755000175000017500000000000011241314101030304 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-three-with-deps/1.0/0000755000175000017500000000000011241314101030602 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-three-with-deps/1.0/jar-sample-three-with-deps-1.0.pommaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-three-with-deps/1.0/jar-sample-t0000644000175000017500000000231111150275561033035 0ustar twernertwerner 4.0.0 eartest jar-sample-three-with-deps jar 1.0 verified eartest jar-sample-two 1.0 maven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/ejb-sample-two/0000755000175000017500000000000011241314101026070 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/0000755000175000017500000000000011241314101026366 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/ejb-sample-two/1.0/ejb-sample-two-1.0.pom0000644000175000017500000000235710537340337032255 0ustar twernertwerner 4.0.0 eartest ejb-sample-two ejb 1.0 verified maven-ejb-plugin true maven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-two/0000755000175000017500000000000011241314101026104 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-two/1.0/0000755000175000017500000000000011241314101026402 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/eartest/jar-sample-two/1.0/jar-sample-two-1.0.pom0000644000175000017500000000201310537340337032272 0ustar twernertwerner 4.0.0 eartest jar-sample-two jar 1.0 verified maven-ear-plugin-2.3.2/src/test/resources/m2repo/com/0000755000175000017500000000000011241314101022351 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/0000755000175000017500000000000011241314101023134 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/0000755000175000017500000000000011241314101023700 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-one/0000755000175000017500000000000011241314101026476 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-one/1.0/0000755000175000017500000000000011241314101026774 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-one/1.0/ejb-sample-one-1.0.pommaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-one/1.0/ejb-sample-one-1.0.p0000644000175000017500000000201710537340337032270 0ustar twernertwerner 4.0.0 com.foo.bar ejb-sample-one ejb 1.0 verified maven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-two/0000755000175000017500000000000011241314101026526 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-two/1.0/0000755000175000017500000000000011241314101027024 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-two/1.0/ejb-sample-two-1.0.pommaven-ear-plugin-2.3.2/src/test/resources/m2repo/com/foo/bar/ejb-sample-two/1.0/ejb-sample-two-1.0.p0000644000175000017500000000236310537340337032354 0ustar twernertwerner 4.0.0 com.foo.bar ejb-sample-two ejb 1.0 verified maven-ejb-plugin true maven-ear-plugin-2.3.2/src/test/java/0000755000175000017500000000000011241314101017276 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/java/org/0000755000175000017500000000000011241314101020065 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/java/org/apache/0000755000175000017500000000000011241314101021306 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/0000755000175000017500000000000011241314101022414 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/0000755000175000017500000000000011241314101023712 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/0000755000175000017500000000000011241314101024461 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/ArtifactTestStub.java0000644000175000017500000002320510537340337030602 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.OverConstrainedVersionException; import org.apache.maven.artifact.versioning.VersionRange; import java.io.File; import java.util.Collection; import java.util.List; /** * A fake {@link Artifact} test stub. * * @author Stephane Nicoll * @version $Id: ArtifactTestStub.java 485857 2006-12-11 20:34:39Z snicoll $ */ public class ArtifactTestStub implements Artifact { private final String groupId; private final String artifactId; private final String type; private final String classifier; public ArtifactTestStub( String groupId, String artifactId, String type, String classifier ) { this.groupId = groupId; this.artifactId = artifactId; this.type = type; this.classifier = classifier; } public String getGroupId() { return groupId; } public String getArtifactId() { return artifactId; } public String getVersion() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setVersion( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public String getScope() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public String getType() { return type; } public String getClassifier() { return classifier; } public boolean hasClassifier() { return classifier != null; } public File getFile() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setFile( File file ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public String getBaseVersion() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setBaseVersion( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public String getId() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public String getDependencyConflictId() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void addMetadata( ArtifactMetadata artifactMetadata ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public Collection getMetadataList() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setRepository( ArtifactRepository artifactRepository ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public ArtifactRepository getRepository() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void updateVersion( String string, ArtifactRepository artifactRepository ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public String getDownloadUrl() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setDownloadUrl( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public ArtifactFilter getDependencyFilter() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setDependencyFilter( ArtifactFilter artifactFilter ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public ArtifactHandler getArtifactHandler() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public List getDependencyTrail() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setDependencyTrail( List list ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setScope( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public VersionRange getVersionRange() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setVersionRange( VersionRange versionRange ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void selectVersion( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setGroupId( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setArtifactId( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public boolean isSnapshot() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setResolved( boolean b ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public boolean isResolved() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setResolvedVersion( String string ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setArtifactHandler( ArtifactHandler artifactHandler ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public boolean isRelease() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setRelease( boolean b ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public List getAvailableVersions() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setAvailableVersions( List list ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public boolean isOptional() { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public void setOptional( boolean b ) { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public ArtifactVersion getSelectedVersion() throws OverConstrainedVersionException { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public boolean isSelectedVersionKnown() throws OverConstrainedVersionException { throw new UnsupportedOperationException( "not implemented ; fake artifact stub" ); } public int compareTo( Object o ) { if ( this.equals( o ) ) { return 0; } else { return 1; } } public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } ArtifactTestStub that = (ArtifactTestStub) o; if ( artifactId != null ? !artifactId.equals( that.artifactId ) : that.artifactId != null ) { return false; } if ( classifier != null ? !classifier.equals( that.classifier ) : that.classifier != null ) { return false; } if ( groupId != null ? !groupId.equals( that.groupId ) : that.groupId != null ) { return false; } if ( type != null ? !type.equals( that.type ) : that.type != null ) { return false; } return true; } public int hashCode() { int result; result = ( groupId != null ? groupId.hashCode() : 0 ); result = 31 * result + ( artifactId != null ? artifactId.hashCode() : 0 ); result = 31 * result + ( type != null ? type.hashCode() : 0 ); result = 31 * result + ( classifier != null ? classifier.hashCode() : 0 ); return result; } } maven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/it/0000755000175000017500000000000011241314101025075 5ustar twernertwernermaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/it/EarMojoIT.java0000644000175000017500000005152011152525671027555 0ustar twernertwernerpackage org.apache.maven.plugin.ear.it; /* * 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.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import java.io.File; import java.util.Properties; /** * @author Stephane Nicoll * @version $Id: EarMojoIT.java 749046 2009-03-01 15:37:29Z snicoll $ * @noinspection JavaDoc */ public class EarMojoIT extends AbstractEarPluginIT { /** * Builds an EAR with a single EJB and no configuration. */ public void testProject001() throws Exception { doTestProject( "project-001", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR with a customized artifact location and a customized artifact name. */ public void testProject002() throws Exception { doTestProject( "project-002", new String[]{"APP-INF/lib/ejb-sample-one-1.0.jar", "ejb-sample-two.jar"} ); } /** * Builds an EAR with a defalt bundle directory for java modules. */ public void testProject003() throws Exception { doTestProject( "project-003", new String[]{"ejb-sample-one-1.0.jar", "APP-INF/lib/jar-sample-one-1.0.jar", "APP-INF/lib/jar-sample-two-1.0.jar"} ); } /** * Builds an EAR with a defalt bundle directory for _java_ modules and a custom * location overriding the default. */ public void testProject004() throws Exception { doTestProject( "project-004", new String[]{"ejb-sample-one-1.0.jar", "jar-sample-one-1.0.jar", "APP-INF/lib/jar-sample-two-1.0.jar"} ); } /** * Builds an EAR with a custom URI. */ public void testProject005() throws Exception { doTestProject( "project-005", new String[]{"ejb-sample-one-1.0.jar", "libs/another-name.jar"} ); } /** * Builds an EAR with an excluded module. */ public void testProject006() throws Exception { doTestProject( "project-006", new String[]{"ejb-sample-one-1.0.jar", "jar-sample-two-1.0.jar"} ); } /** * Builds an EAR with a classified artifact and no extra configuration. */ public void testProject007() throws Exception { doTestProject( "project-007", new String[]{"ejb-sample-one-1.0-classified.jar"} ); } /** * Builds an EAR with deployment descriptor configuration for J2EE 1.3. */ public void testProject008() throws Exception { doTestProject( "project-008", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR with deployment descriptor configuration for J2EE 1.4. */ public void testProject009() throws Exception { doTestProject( "project-009", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR with deployment descriptor configuration for Java EE 5. */ public void testProject010() throws Exception { doTestProject( "project-010", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that deployment descriptor default settings are applied. */ public void testProject011() throws Exception { doTestProject( "project-011", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that EAR resources are bundled within the EAR. */ public void testProject012() throws Exception { doTestProject( "project-012", new String[]{"README.txt", "LICENSE.txt", "ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that EAR resources in a customized resources directory are bundled within the EAR. */ public void testProject013() throws Exception { doTestProject( "project-013", new String[]{"README.txt", "LICENSE.txt", "ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that EAR resources are bundled within the EAR using includes and excludes. */ public void testProject014() throws Exception { doTestProject( "project-014", new String[]{"LICENSE.txt", "ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that default manifest is taken into account. */ public void testProject015() throws Exception { final File baseDir = doTestProject( "project-015", new String[]{"ejb-sample-one-1.0.jar"} ); final File expectedManifest = new File( baseDir, "src/main/application/META-INF/MANIFEST.MF" ); final File actualManifest = new File( getEarDirectory( baseDir, "project-015" ), "META-INF/MANIFEST.MF" ); assertTrue( "Manifest was not copied", actualManifest.exists() ); assertTrue( FileUtils.contentEquals( expectedManifest, actualManifest ) ); } /** * Builds an EAR and make sure that custom manifest is taken into account. */ public void testProject016() throws Exception { System.out.println( "Skipped project-016: need a way to extract the EAR archive" ); /* final File baseDir = doTestProject( "project-016", new String[]{"ejb-sample-one-1.0.jar"} ); final File expectedManifest = new File(baseDir, "src/main/ear/META-INF/MANIFEST.MF"); // TODO: needs a way to extract the EAR archive */ } /** * Builds an EAR and make sure that custom application.xml is taken into account. */ public void testProject017() throws Exception { doTestProject( "project-017", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR with a custom final name. */ public void testProject018() throws Exception { final File baseDir = executeMojo( "project-018", new Properties() ); final File expectedFile = new File( baseDir, "target/my-custom-file.ear" ); assertTrue( "EAR archive not found", expectedFile.exists() ); } /** * Builds an EAR with unpacked archives using the unpackTypes. */ public void testProject019() throws Exception { doTestProject( "project-019", new String[]{"ejb-sample-one-1.0.jar", "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar"}, new boolean[]{false, true, true} ); } /** * Builds an EAR with unpacked archives using the unpack module attribute. */ public void testProject020() throws Exception { doTestProject( "project-020", new String[]{"ejb-sample-one-1.0.jar", "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar"}, new boolean[]{true, false, false} ); } /** * Builds an EAR with unpacked archives using both unpackTypes and the unpack module attribute. */ public void testProject021() throws Exception { doTestProject( "project-021", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar", "sar-sample-one-1.0.sar", "jar-sample-one-1.0.jar", "jar-sample-two-1.0.jar"}, new boolean[]{false, true, false, false, true} ); } /** * Builds an EAR with a classifier. */ public void testProject022() throws Exception { final File baseDir = executeMojo( "project-022", new Properties() ); final File expectedFile = new File( baseDir, "target/maven-ear-plugin-test-project-022-99.0-myclassifier.ear" ); assertTrue( "EAR archive not found", expectedFile.exists() ); } /** * Builds an EAR and make sure that a single classified dependency is detected without specifying the classifier. */ public void testProject023() throws Exception { doTestProject( "project-023", new String[]{"ejb-sample-one-1.0-classified.jar", "ejb-sample-two-1.0.jar"}, new boolean[]{true, false} ); } /** * Builds an EAR and make sure that a single classified dependency is detected when specifying the classifier. */ public void testProject024() throws Exception { doTestProject( "project-024", new String[]{"ejb-sample-one-1.0-classified.jar", "ejb-sample-two-1.0.jar"}, new boolean[]{true, false} ); } /** * Builds an EAR and make sure that a classified dependency with mutiple candidates is detected when specifying the classifier. */ public void testProject025() throws Exception { doTestProject( "project-025", new String[]{"ejb-sample-one-1.0-classified.jar", "ejb-sample-one-1.0.jar"}, new boolean[]{true, false} ); } /** * Builds an EAR and make sure that the build fails if a unclassifed module configuration with mutiple candidates is specified. */ public void testProject026() throws Exception { final File baseDir = executeMojo( "project-026", new Properties(), false ); // Stupido, checks that the ear archive is not there assertFalse( "Execution should have failed", getEarArchive( baseDir, "project-026" ).exists() ); } /** * Builds an EAR and make sure that provided dependencies are not included in the EAR. */ public void testProject027() throws Exception { doTestProject( "project-027", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that test dependencies are not included in the EAR. */ public void testProject028() throws Exception { doTestProject( "project-028", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that system dependencies are not included in the EAR. */ public void testProject029() throws Exception { doTestProject( "project-029", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR and make sure that ejb-client dependencies are detected and not added by default in the * generated application.xml. */ public void testProject030() throws Exception { doTestProject( "project-030", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0-client.jar"} ); } /** * Builds an EAR with a Jboss 4 configuration specifying the security domain and the * unauthenticated-principal to use. */ public void testProject031() throws Exception { doTestProject( "project-031", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 3.2 configuration specifying the jmx-name to use. */ public void testProject032() throws Exception { doTestProject( "project-032", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 4 configuration and Jboss specific modules. */ public void testProject033() throws Exception { doTestProject( "project-033", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar", "sar-sample-one-1.0.sar", "har-sample-one-1.0.har"} ); } /** * Builds an EAR with custom security settings. */ public void testProject034() throws Exception { doTestProject( "project-034", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a full filename mapping and make sure that custom locations are not overriden. */ public void testProject035() throws Exception { doTestProject( "project-035", new String[]{"foo/eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar", "libs/eartest-jar-sample-one-1.0.jar", "libs/eartest-jar-sample-two-1.0.jar", "sar-sample-one.sar"} ); } /** * Builds an EAR with a full filename mapping and make sure that groupIds with dots are replaced by dashes in filenames. */ public void testProject036() throws Exception { doTestProject( "project-036", new String[]{"foo/eartest-ejb-sample-one-1.0.jar", "eartest-ejb-sample-two-1.0.jar", "com-foo-bar-ejb-sample-one-1.0.jar", "com-foo-bar-ejb-sample-two-1.0.jar", "libs/eartest-jar-sample-one-1.0.jar", "libs/eartest-jar-sample-two-1.0.jar", "sar-sample-one.sar"} ); } /** * Builds an EAR and make sure that ejb-client dependencies are detected and added in the generated application.xml if * includeInApplicationXml is set. */ public void testProject037() throws Exception { doTestProject( "project-037", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0-client.jar"} ); } /** * Builds an EAR and make sure that a non-classified dependency with mutiple candidates is * detected when specifying the mainArtifactId as classifier. */ public void testProject038() throws Exception { doTestProject( "project-038", new String[]{"ejb-sample-one-1.0-classified.jar", "ejb-sample-one-1.0.jar"}, new boolean[]{false, true} ); } /** * Builds an EAR with a Jboss 4 configuration specifying specifying the loader repository to use. */ public void testProject039() throws Exception { doTestProject( "project-039", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with deployment descriptor configuration for Java EE 5 and * an alternative deployment descriptor. */ public void testProject040() throws Exception { doTestProject( "project-040", new String[]{"ejb-sample-one-1.0.jar"} ); } /** * Builds an EAR with a Jboss 4.2 configuration specifying the module order to use. */ public void testProject041() throws Exception { doTestProject( "project-041", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 4.2 configuration specifying a datasource to add. */ public void testProject042() throws Exception { doTestProject( "project-042", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a custom descriptor location (generatedDescriptorLocation setting). */ public void testProject043() throws Exception { final File baseDir = doTestProject( "project-043", new String[]{"ejb-sample-one-1.0.jar"} ); final File expectedApplicationXml = new File( baseDir, "target/custom-descriptor-dir/application.xml" ); assertTrue( "Application.xml file not found", expectedApplicationXml.exists() ); assertFalse( "Application.xml file should not be empty", expectedApplicationXml.length() == 0 ); } /** * Builds an EAR with a custom library-directory. */ public void testProject044() throws Exception { doTestProject( "project-044", new String[]{"ejb-sample-one-1.0.jar", "myLibs/jar-sample-one-1.0.jar"} ); } /** * Builds an EAR and filter the content of the sources directory. */ public void testProject045() throws Exception { final File baseDir = doTestProject( "project-045", new String[]{"README.txt", "ejb-sample-one-1.0.jar"} ); final File actualReadme = new File( getEarDirectory( baseDir, "project-045" ), "README.txt" ); final String content = IOUtil.toString( ReaderFactory.newReader( actualReadme, "UTF-8" ) ); assertTrue( "application name and version was not filtered properly", content.indexOf( "my-app 99.0" ) != -1 ); assertTrue( "Escaping did not work properly", content.indexOf( "will not be filtered ${application.name}." ) != -1 ); } /** * Builds an EAR and filter the content of the sources directory using * a custom filter file. */ public void testProject046() throws Exception { final File baseDir = doTestProject( "project-046", new String[]{"README.txt", "ejb-sample-one-1.0.jar"} ); final File actualReadme = new File( getEarDirectory( baseDir, "project-046" ), "README.txt" ); final String content = IOUtil.toString( ReaderFactory.newReader( actualReadme, "UTF-8" ) ); assertTrue( "application name and version was not filtered properly", content.indexOf( "my-app 99.0" ) != -1 ); assertTrue( "application build was not filtered properly", content.indexOf( "(Build 2)" ) != -1 ); assertTrue( "Unknown property should not have been filtered", content.indexOf( "will not be filtered ${application.unknown}." ) != -1 ); } /** * Builds an EAR and filter the content with a list of extensions. */ public void testProject047() throws Exception { final File baseDir = doTestProject( "project-047", new String[]{"README.txt", "ejb-sample-one-1.0.jar"} ); final File actualReadme = new File( getEarDirectory( baseDir, "project-047" ), "README.txt" ); final String content = IOUtil.toString( ReaderFactory.newReader( actualReadme, "UTF-8" ) ); assertTrue( "application name and version should not have been filtered", content.indexOf( "my-app 99.0" ) == -1 ); assertTrue( "orignial properties not found", content.indexOf( "${application.name} ${project.version}" ) != -1 ); } /** * Builds an EAR with a Jboss 5 configuration containing library directory. */ public void testProject048() throws Exception { doTestProject( "project-048", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 4.2 configuration containing a library directory. */ public void testProject049() throws Exception { doTestProject( "project-049", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 5 configuration containing a loader repository configuration definition. */ public void testProject050() throws Exception { doTestProject( "project-050", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 5 configuration containing a loader repository class definition. */ public void testProject051() throws Exception { doTestProject( "project-051", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 5 configuration containing a configuration parser class definition. */ public void testProject052() throws Exception { doTestProject( "project-052", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with a Jboss 5 configuration containing only the loader repo configuration */ public void testProject053() throws Exception { doTestProject( "project-053", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with deployment descriptor configuration for Java EE 5 and no application.xml */ public void testProject054() throws Exception { doTestProject( "project-054", new String[]{"ejb-sample-one-1.0.jar", "ejb-sample-two-1.0.jar"} ); } /** * Builds an EAR with jar dependencies added in application.xml. */ public void testProject055() throws Exception { doTestProject( "project-055", new String[]{"jar-sample-one-1.0.jar", "jar-sample-two-1.0.jar", "jar-sample-three-with-deps-1.0.jar"} ); } /** * Builds an EAR with deployment descriptor configuration for J2EE 1.4 and * an alternative deployment descriptor. */ public void testProject056() throws Exception { doTestProject( "project-056", new String[]{"ejb-sample-one-1.0.jar"} ); } } maven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/it/AbstractEarPluginIT.java0000644000175000017500000003703011150271340031560 0ustar twernertwernerpackage org.apache.maven.plugin.ear.it; /* * 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 junit.framework.TestCase; import org.apache.maven.it.VerificationException; import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; import org.codehaus.plexus.util.ReaderFactory; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.XMLAssert; import org.custommonkey.xmlunit.examples.RecursiveElementNameAndTextQualifier; import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.io.Reader; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Properties; /** * Base class for ear test cases. * * @author Stephane Nicoll * @version $Id: AbstractEarPluginIT.java 746740 2009-02-22 15:44:32Z snicoll $ */ public abstract class AbstractEarPluginIT extends TestCase { protected final String FINAL_NAME_PREFIX = "maven-ear-plugin-test-"; protected final String FINAL_NAME_SUFFIX = "-99.0"; /** * The base directory. */ private File basedir; /** * Test repository directory. */ protected File localRepositoryDir = new File( getBasedir().getAbsolutePath(), "target/test-classes/m2repo" ); protected File settingsFile = new File( getBasedir().getAbsolutePath(), "target/test-classes/settings.xml" ); /** * Execute the EAR plugin for the specified project. * * @param projectName the name of the project * @param properties extra properties to be used by the embedder * @return the base directory of the project * @throws Exception if an error occured */ protected File executeMojo( final String projectName, final Properties properties, boolean expectNoError ) throws Exception { System.out.println( " Building: " + projectName ); File testDir = getTestDir( projectName ); Verifier verifier = new Verifier( testDir.getAbsolutePath() ); // Let's add alternate settings.xml setting so that the latest dependencies are used verifier.getCliOptions().add( "-s \"" + settingsFile.getAbsolutePath() + "\"" ); verifier.getCliOptions().add( "-X" ); verifier.localRepo = localRepositoryDir.getAbsolutePath(); // On linux and macOSX, an exception is thrown if a build failure occurs underneath try { verifier.executeGoal( "package" ); } catch ( VerificationException e ) { //@TODO needs to be handled nicely in the verifier if ( expectNoError || e.getMessage().indexOf( "Exit code was non-zero" ) == -1 ) { throw e; } } // If no error is expected make sure that error logs are free if ( expectNoError ) { verifier.verifyErrorFreeLog(); } verifier.resetStreams(); return testDir; } /** * Execute the EAR plugin for the specified project. * * @param projectName the name of the project * @param properties extra properties to be used by the embedder * @return the base directory of the project * @throws Exception if an error occured */ protected File executeMojo( final String projectName, final Properties properties ) throws Exception { return executeMojo( projectName, properties, true ); } /** * Executes the specified projects and asserts the given artifacts. * * @param projectName the project to test * @param expectedArtifacts the list of artifacts to be found in the EAR archive * @param artifactsDirectory whether the artifact is an exploded artifactsDirectory or not * @param testDeploymentDescriptors whether we should test deployemnt descriptors * @return the base directory of the project * @throws Exception */ protected File doTestProject( final String projectName, final String[] expectedArtifacts, final boolean[] artifactsDirectory, boolean testDeploymentDescriptors ) throws Exception { final File baseDir = executeMojo( projectName, new Properties() ); assertEarArchive( baseDir, projectName ); assertEarDirectory( baseDir, projectName ); assertArchiveContent( baseDir, projectName, expectedArtifacts, artifactsDirectory ); if ( testDeploymentDescriptors ) { assertDeploymentDescriptors( baseDir, projectName ); } return baseDir; } /** * Executes the specified projects and asserts the given artifacts. Assert the * deployment descriptors are valid * * @param projectName the project to test * @param expectedArtifacts the list of artifacts to be found in the EAR archive * @param artifactsDirectory whether the artifact is an exploded artifactsDirectory or not * @return the base directory of the project * @throws Exception */ protected File doTestProject( final String projectName, final String[] expectedArtifacts, final boolean[] artifactsDirectory ) throws Exception { return doTestProject( projectName, expectedArtifacts, artifactsDirectory, true ); } /** * Executes the specified projects and asserts the given artifacts as * artifacts (non directory) * * @param projectName the project to test * @param expectedArtifacts the list of artifacts to be found in the EAR archive * @param testDeploymentDescriptors whether we should test deployemnt descriptors * @return the base directory of the project * @throws Exception */ protected File doTestProject( final String projectName, final String[] expectedArtifacts, boolean testDeploymentDescriptors ) throws Exception { return doTestProject( projectName, expectedArtifacts, new boolean[expectedArtifacts.length] ); } /** * Executes the specified projects and asserts the given artifacts as * artifacts (non directory). Assert the deployment descriptors are valid * * @param projectName the project to test * @param expectedArtifacts the list of artifacts to be found in the EAR archive * @return the base directory of the project * @throws Exception */ protected File doTestProject( final String projectName, final String[] expectedArtifacts ) throws Exception { return doTestProject( projectName, expectedArtifacts, true ); } protected void assertEarArchive( final File baseDir, final String projectName ) { assertTrue( "EAR archive does not exist", getEarArchive( baseDir, projectName ).exists() ); } protected void assertEarDirectory( final File baseDir, final String projectName ) { assertTrue( "EAR archive directory does not exist", getEarDirectory( baseDir, projectName ).exists() ); } protected File getTargetDirectory( final File basedir ) { return new File( basedir, "target" ); } protected File getEarArchive( final File baseDir, final String projectName ) { return new File( getTargetDirectory( baseDir ), buildFinalName( projectName ) + ".ear" ); } protected File getEarDirectory( final File baseDir, final String projectName ) { return new File( getTargetDirectory( baseDir ), buildFinalName( projectName ) ); } protected String buildFinalName( final String projectName ) { return FINAL_NAME_PREFIX + projectName + FINAL_NAME_SUFFIX; } protected void assertArchiveContent( final File baseDir, final String projectName, final String[] artifactNames, final boolean[] artifactsDirectory ) { // sanity check assertEquals( "Wrong parameter, artifacts mismatch directory flags", artifactNames.length, artifactsDirectory.length ); File dir = getEarDirectory( baseDir, projectName ); // Let's build the expected directories sort list final List expectedDirectories = new ArrayList(); for ( int i = 0; i < artifactsDirectory.length; i++ ) { if ( artifactsDirectory[i] ) { expectedDirectories.add( new File( dir, artifactNames[i] ) ); } } final List actualFiles = buildArchiveContentFiles( dir, expectedDirectories ); assertEquals( "Artifacts mismatch " + actualFiles, artifactNames.length, actualFiles.size() ); for ( int i = 0; i < artifactNames.length; i++ ) { String artifactName = artifactNames[i]; final boolean isDirectory = artifactsDirectory[i]; File expectedFile = new File( dir, artifactName ); assertEquals( "Artifact[" + artifactName + "] not in the right form (exploded/archive", isDirectory, expectedFile.isDirectory() ); assertTrue( "Artifact[" + artifactName + "] not found in ear archive", actualFiles.contains( expectedFile ) ); } } protected List buildArchiveContentFiles( final File baseDir, final List expectedDirectories ) { final List result = new ArrayList(); addFiles( baseDir, result, expectedDirectories ); return result; } private void addFiles( final File directory, final List files, final List expectedDirectories ) { File[] result = directory.listFiles( new FilenameFilter() { public boolean accept( File dir, String name ) { if ( name.equals( "META-INF" ) ) { return false; } else { return true; } } } ); /* Kinda complex. If we found a file, we always add it to the list of files. If a directory is within the expectedDirectories short list we add it but we don't add it's content. Otherwise, we don't add the directory *BUT* we browse it's content */ for ( int i = 0; i < result.length; i++ ) { File file = result[i]; if ( file.isFile() ) { files.add( file ); } else if ( expectedDirectories.contains( file ) ) { files.add( file ); } else { addFiles( file, files, expectedDirectories ); } } } protected File getBasedir() { if ( basedir != null ) { return basedir; } final String basedirString = System.getProperty( "basedir" ); if ( basedirString == null ) { basedir = new File( "" ); } else { basedir = new File( basedirString ); } return basedir; } protected File getTestDir( String projectName ) throws IOException { return ResourceExtractor.simpleExtractResources( getClass(), "/projects/" + projectName ); } // Generated application.xml stuff /** * Asserts that the deployment descriptors have been generated successfully. *

* This test assumes that deployment descriptors are located in the * expected-META-INF directory of the project. Note that the * MANIFEST.mf file is ignored and is not tested. * * @param baseDir the directory of the tested project * @param projectName the name of the project */ protected void assertDeploymentDescriptors( final File baseDir, final String projectName ) throws IOException { final File earDirectory = getEarDirectory( baseDir, projectName ); final File[] actualDeploymentDescriptors = getDeploymentDescriptors( new File( earDirectory, "META-INF" ) ); final File[] expectedDeploymentDescriptors = getDeploymentDescriptors( new File( baseDir, "expected-META-INF" ) ); if ( expectedDeploymentDescriptors == null ) { assertNull( "No deployment descriptor was expected", actualDeploymentDescriptors ); } else { assertNotNull( "Missing deployment descriptor", actualDeploymentDescriptors ); // Make sure we have the same number of files assertEquals( "Number of Deployment descriptor(s) mismatch", expectedDeploymentDescriptors.length, actualDeploymentDescriptors.length ); // Sort the files so that we have the same behavior here Arrays.sort( expectedDeploymentDescriptors ); Arrays.sort( actualDeploymentDescriptors ); for ( int i = 0; i < expectedDeploymentDescriptors.length; i++ ) { File expectedDeploymentDescriptor = expectedDeploymentDescriptors[i]; File actualDeploymentDescriptor = actualDeploymentDescriptors[i]; assertEquals( "File name mismatch", expectedDeploymentDescriptor.getName(), actualDeploymentDescriptor.getName() ); Reader expected = null; Reader actual = null; try { expected = ReaderFactory.newXmlReader( expectedDeploymentDescriptor ); actual = ReaderFactory.newXmlReader( actualDeploymentDescriptor ); // Make sure that it matches even if the elements are not in // the exact same order final Diff myDiff = new Diff( expected, actual ); myDiff.overrideElementQualifier( new RecursiveElementNameAndTextQualifier() ); XMLAssert.assertXMLEqual( "Wrong deployment descriptor generated for[" + expectedDeploymentDescriptor.getName() + "]", myDiff, true ); } catch ( Exception e ) { e.printStackTrace(); fail( "Could not assert deployment descriptor " + e.getMessage() ); } finally { if ( expected != null ) { expected.close(); } if ( actual != null ) { actual.close(); } } } } } private File[] getDeploymentDescriptors( final File ddDirectory ) { return ddDirectory.listFiles( new FilenameFilter() { public boolean accept( File dir, String name ) { return !name.equalsIgnoreCase( "manifest.mf" ); } } ); } } maven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/EarModuleTest.java0000644000175000017500000000304611123544663030065 0ustar twernertwernerpackage 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 junit.framework.TestCase; /** * Ear module test case. * * @author Stephane Nicoll * @version $Id: EarModuleTest.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class EarModuleTest extends TestCase { public void testCleanBuildDir() { assertEquals("APP-INF/lib/", AbstractEarModule.cleanBundleDir( "APP-INF/lib")); assertEquals("APP-INF/lib/", AbstractEarModule.cleanBundleDir( "APP-INF/lib/")); assertEquals("APP-INF/lib/", AbstractEarModule.cleanBundleDir( "/APP-INF/lib")); assertEquals("APP-INF/lib/", AbstractEarModule.cleanBundleDir( "/APP-INF/lib/")); assertEquals("", AbstractEarModule.cleanBundleDir( "/")); } } maven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/output/0000755000175000017500000000000011241314101026021 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/output/FileNameMappingFactoryTest.javamaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/output/FileNameMappingFactoryTest.j0000644000175000017500000000671610537340337033413 0ustar twernertwernerpackage org.apache.maven.plugin.ear.output; /* * 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 junit.framework.TestCase; /* * Copyright 2001-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. */ /** * @author Stephane Nicoll * @version $Id: FileNameMappingFactoryTest.java 485857 2006-12-11 20:34:39Z snicoll $ */ public class FileNameMappingFactoryTest extends TestCase { public void testDefaultFileNameMapping() { final FileNameMapping actual = FileNameMappingFactory.INSTANCE.getDefaultFileNameMapping(); assertNotNull( actual ); assertEquals( StandardFileNameMapping.class, actual.getClass() ); } public void testGetFileNameMappingByName() { final FileNameMapping actual = FileNameMappingFactory.INSTANCE.getFileNameMapping( FileNameMappingFactory.STANDARD_FILE_NAME_MAPPING ); assertNotNull( actual ); assertEquals( StandardFileNameMapping.class, actual.getClass() ); } public void testGetFileNameMappingByName2() { final FileNameMapping actual = FileNameMappingFactory.INSTANCE.getFileNameMapping( FileNameMappingFactory.FULL_FILE_NAME_MAPPING ); assertNotNull( actual ); assertEquals( FullFileNameMapping.class, actual.getClass() ); } public void testGetFileNameMappingByClass() { final FileNameMapping actual = FileNameMappingFactory.INSTANCE.getFileNameMapping(StandardFileNameMapping.class.getName()); assertNotNull( actual); assertEquals( StandardFileNameMapping.class, actual.getClass()); } public void testGetFileNameMappingByClass2() { final FileNameMapping actual = FileNameMappingFactory.INSTANCE.getFileNameMapping( FullFileNameMapping.class.getName() ); assertNotNull( actual ); assertEquals( FullFileNameMapping.class, actual.getClass() ); } public void testGetFileNameMappingByUnknownClass() { try { FileNameMappingFactory.INSTANCE.getFileNameMapping( "com.foo.bar" ); fail("Should have failed"); } catch ( IllegalStateException e ) { // OK } } } maven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/util/0000755000175000017500000000000011241314101025436 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingServiceTest.javamaven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingServiceTest0000644000175000017500000002075111123544663033503 0ustar twernertwernerpackage org.apache.maven.plugin.ear.util; /* * 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 junit.framework.TestCase; import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; import org.apache.maven.plugin.ear.util.ArtifactTypeMappingService; import org.apache.maven.plugin.ear.EarModuleFactory; import org.apache.maven.plugin.ear.UnknownArtifactTypeException; import org.apache.maven.plugin.ear.EarPluginException; import java.util.Iterator; /** * Tests for the {@link ArtifactTypeMappingService} * * @author Stephane Nicoll * @version $Id: ArtifactTypeMappingServiceTest.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class ArtifactTypeMappingServiceTest extends TestCase { public void testDefaultConfiguration() { ArtifactTypeMappingService service = getDefaultService(); final Iterator it = EarModuleFactory.getStandardArtifactTypes().iterator(); while ( it.hasNext() ) { String type = (String) it.next(); assertTrue( "Standard type could not be found", service.isMappedToType( type, type ) ); } } public void testIsMappedToTypeForUnknownType() { ArtifactTypeMappingService service = getDefaultService(); assertFalse( service.isMappedToType( "rar", "MyKoolCustomType" ) ); } public void testIsMappedToTypeForKnownType() { ArtifactTypeMappingService service = getServiceWithRarMappingToMyRar(); assertTrue( service.isMappedToType( "rar", "MyRar" ) ); } public void testGetStandardTypeForUknonwnType() { try { ArtifactTypeMappingService service = getDefaultService(); service.getStandardType( "MyKoolCustomType" ); fail( "Should have failed to retrieve a unknwon custom type" ); } catch ( UnknownArtifactTypeException e ) { // That's good } } public void testGetStandardTypeForKnownType() { try { ArtifactTypeMappingService service = getServiceWithRarMappingToMyRar(); assertEquals( "rar", service.getStandardType( "MyRar" ) ); } catch ( UnknownArtifactTypeException e ) { fail( "Should not have failed to retrieve a knwon custom type " + e.getMessage() ); } } public void testConfigWithSameCustomType() { try { XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration( "dummy" ); XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration( ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT ); childConfig.setAttribute( "type", "generic" ); childConfig.setAttribute( "mapping", "rar" ); XmlPlexusConfiguration childConfig2 = new XmlPlexusConfiguration( ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT ); childConfig.setAttribute( "type", "generic" ); childConfig.setAttribute( "mapping", "ejb" ); rootConfig.addChild( childConfig ); rootConfig.addChild( childConfig2 ); ArtifactTypeMappingService service = ArtifactTypeMappingService.getInstance(); service.configure( rootConfig ); fail( "Should have failed" ); } catch ( EarPluginException e ) { //OK } catch ( PlexusConfigurationException e ) { e.printStackTrace(); fail( "Unexpected " + e.getMessage() ); } } public void testConfigWithUnknownStandardType() { try { XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration( "dummy" ); XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration( ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT ); childConfig.setAttribute( "type", "generic" ); childConfig.setAttribute( "mapping", "notAStandardType" ); rootConfig.addChild( childConfig ); ArtifactTypeMappingService service = ArtifactTypeMappingService.getInstance(); service.configure( rootConfig ); fail( "Should have failed" ); } catch ( EarPluginException e ) { //OK } catch ( PlexusConfigurationException e ) { e.printStackTrace(); fail( "Unexpected " + e.getMessage() ); } } public void testConfigWithNoType() { try { XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration( "dummy" ); XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration( ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT ); childConfig.setAttribute( "mapping", "ejb" ); rootConfig.addChild( childConfig ); ArtifactTypeMappingService service = ArtifactTypeMappingService.getInstance(); service.configure( rootConfig ); fail( "Should have failed" ); } catch ( EarPluginException e ) { //OK } catch ( PlexusConfigurationException e ) { e.printStackTrace(); fail( "Unexpected " + e.getMessage() ); } } public void testConfigWithNoMapping() { try { XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration( "dummy" ); XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration( ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT ); childConfig.setAttribute( "type", "generic" ); rootConfig.addChild( childConfig ); ArtifactTypeMappingService service = ArtifactTypeMappingService.getInstance(); service.configure( rootConfig ); fail( "Should have failed" ); } catch ( EarPluginException e ) { //OK } catch ( PlexusConfigurationException e ) { e.printStackTrace(); fail( "Unexpected " + e.getMessage() ); } } // Utilities protected ArtifactTypeMappingService getServiceWithRarMappingToMyRar() { try { XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration( "artifact-type-mappings" ); XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration( ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT ); childConfig.setAttribute( "type", "MyRar" ); childConfig.setAttribute( "mapping", "rar" ); rootConfig.addChild( childConfig ); ArtifactTypeMappingService service = ArtifactTypeMappingService.getInstance(); service.configure( rootConfig ); return service; } catch ( EarPluginException e ) { e.printStackTrace(); fail( e.getMessage() ); } catch ( PlexusConfigurationException e ) { e.printStackTrace(); fail( e.getMessage() ); } // Won't occur return null; } protected ArtifactTypeMappingService getDefaultService() { try { ArtifactTypeMappingService service = ArtifactTypeMappingService.getInstance(); service.configure( new XmlPlexusConfiguration( "dummy" ) ); return service; } catch ( EarPluginException e ) { e.printStackTrace(); fail( e.getMessage() ); } catch ( PlexusConfigurationException e ) { e.printStackTrace(); fail( e.getMessage() ); } // Won't occur return null; } } maven-ear-plugin-2.3.2/src/test/java/org/apache/maven/plugin/ear/util/ArtifactRepositoryTest.java0000644000175000017500000001327710601246462033025 0ustar twernertwernerpackage org.apache.maven.plugin.ear.util; /* * 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 junit.framework.TestCase; import org.apache.maven.plugin.ear.ArtifactTestStub; import java.util.Set; import java.util.TreeSet; /** * @author Stephane Nicoll * @version $Id: ArtifactRepositoryTest.java 522047 2007-03-24 16:09:22Z snicoll $ */ public class ArtifactRepositoryTest extends TestCase { protected void setUp() throws Exception { super.setUp(); ArtifactTypeMappingService.getInstance().configure( null ); } public static final String DEFAULT_GROUPID = "eartest"; public static final String DEFAULT_TYPE = "jar"; public static final String MAIN_ARTIFACT_ID = "none"; public void testEmptyRepository() { ArtifactRepository repo = new ArtifactRepository( createArtifacts( null ), MAIN_ARTIFACT_ID ); assertNull( repo.getUniqueArtifact( "ear", "ar", "jar" ) ); assertNull( repo.getUniqueArtifact( "ear", "ar", "jar", null ) ); assertNull( repo.getUniqueArtifact( "ear", "ar", "jar", "class" ) ); } public void testRepositoryWithOneUnclassifiedArtifact() { ArtifactRepository repo = new ArtifactRepository( createArtifacts( new String[]{"myartifact"} ), MAIN_ARTIFACT_ID ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", null ) ); } public void testRepositoryWithOneClassifiedArtifact() { ArtifactRepository repo = new ArtifactRepository( createArtifacts( new String[]{"myartifact"}, null, null, new String[]{"classified"} ), MAIN_ARTIFACT_ID ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "classified" ) ); assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "wrong" ) ); } public void testRepositoryWithMultipleClassifiedArtifacts() { ArtifactRepository repo = new ArtifactRepository( createArtifacts( new String[]{"myartifact", "myartifact", "myartifact"}, null, null, new String[]{"class1", "class2", "class3"} ), MAIN_ARTIFACT_ID ); assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "class1" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "class2" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "class3" ) ); assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "wrong" ) ); } public void testRepositoryWithMultipleClassifiedArtifactsAndMainArtifact() { ArtifactRepository repo = new ArtifactRepository( createArtifacts( new String[]{"myartifact", "myartifact", "myartifact"}, null, null, new String[]{"class1", "class2", null} ), MAIN_ARTIFACT_ID ); assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "class1" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "class2" ) ); assertNotNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", MAIN_ARTIFACT_ID ) ); assertNull( repo.getUniqueArtifact( DEFAULT_GROUPID, "myartifact", "jar", "wrong" ) ); } private Set createArtifacts( String[] artifactsId ) { return createArtifacts( artifactsId, null ); } private Set createArtifacts( String[] artifactsId, String[] types ) { return createArtifacts( artifactsId, types, null ); } private Set createArtifacts( String[] artifactsId, String[] types, String[] groupsId ) { return createArtifacts( artifactsId, types, groupsId, null ); } private Set createArtifacts( String[] artifactsId, String[] types, String[] groupsId, String[] classifiers ) { Set result = new TreeSet(); if ( artifactsId == null || artifactsId.length == 0 ) { return result; } for ( int i = 0; i < artifactsId.length; i++ ) { String artifactId = artifactsId[i]; String type = getData( types, i, DEFAULT_TYPE ); String groupId = getData( groupsId, i, DEFAULT_GROUPID ); String classifier = getData( classifiers, i, null ); result.add( new ArtifactTestStub( groupId, artifactId, type, classifier ) ); } return result; } private String getData( String[] data, int i, String defaultValue ) { if ( data == null || data[i] == null ) { return defaultValue; } else { return data[i]; } } } maven-ear-plugin-2.3.2/src/main/0000755000175000017500000000000011241314103016324 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/0000755000175000017500000000000011241314103020336 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/org/0000755000175000017500000000000011241314103021125 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/org/apache/0000755000175000017500000000000011241314103022346 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/org/apache/maven/0000755000175000017500000000000011241314103023454 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/org/apache/maven/plugin/0000755000175000017500000000000011241314103024752 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/org/apache/maven/plugin/ear/0000755000175000017500000000000011241314103025521 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/META-INF/0000755000175000017500000000000011241314103021476 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/resources/META-INF/plexus/0000755000175000017500000000000011241314103023016 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/0000755000175000017500000000000011241314102017244 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/org/0000755000175000017500000000000011241314102020033 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/org/apache/0000755000175000017500000000000011241314102021254 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/0000755000175000017500000000000011241314102022362 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/0000755000175000017500000000000011241314102023660 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/0000755000175000017500000000000011241314103024430 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/JarModule.java0000644000175000017500000000620311150275561027173 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.util.xml.XMLWriter; import java.util.Set; /** * The {@link EarModule} implementation for a non J2EE module such as * third party libraries. *

* Such module is not incorporated in the generated application.xml * but some application servers support it. To include it in the generated * deployment descriptor anyway, set the includeInApplicationXml * boolean flag. *

* This class deprecates {@link org.apache.maven.plugin.ear.JavaModule}. * * @author Stephane Nicoll * @version $Id: JarModule.java 746754 2009-02-22 16:21:05Z snicoll $ */ public class JarModule extends AbstractEarModule { private Boolean includeInApplicationXml = Boolean.FALSE; public JarModule() { super(); } public JarModule( Artifact a, String defaultLibBundleDir, Boolean includeInApplicationXml ) { super( a ); setLibBundleDir( defaultLibBundleDir ); this.includeInApplicationXml = includeInApplicationXml; } public void appendModule( XMLWriter writer, String version ) { // Generates an entry in the application.xml only if // includeInApplicationXml is set if ( includeInApplicationXml.booleanValue() ) { writer.startElement( MODULE_ELEMENT ); writer.startElement( JAVA_MODULE ); writer.writeText( getUri() ); writer.endElement(); writeAltDeploymentDescriptor( writer, version); writer.endElement(); } } public void resolveArtifact( Set artifacts ) throws EarPluginException, MojoFailureException { // Let's resolve the artifact super.resolveArtifact( artifacts ); // If the defaultLibBundleDir is set and no bundle dir is // set, set the default as bundle dir setLibBundleDir( EarExecutionContext.getInstance().getDefaultLibBundleDir() ); } public String getType() { return "jar"; } private void setLibBundleDir( String defaultLibBundleDir ) { if ( defaultLibBundleDir != null && bundleDir == null ) { this.bundleDir = defaultLibBundleDir; } } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/AbstractXmlWriter.java0000644000175000017500000000472011137064552030735 0ustar twernertwernerpackage 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.WriterFactory; import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter; import org.codehaus.plexus.util.xml.XMLWriter; import java.io.File; import java.io.IOException; import java.io.Writer; /** * A base class for deployment descriptor file generators. * * @author Stephane Nicoll * @version $Id: AbstractXmlWriter.java 737508 2009-01-25 13:30:18Z bentmann $ */ abstract class AbstractXmlWriter { private final String encoding; protected static final String MODULE_ELEMENT = "module"; protected static final String SERVICE_ELEMENT = "service"; AbstractXmlWriter( String encoding ) { this.encoding = encoding; } protected Writer initializeWriter( final File destinationFile ) throws EarPluginException { try { return WriterFactory.newXmlWriter( destinationFile ); } catch ( IOException ex ) { throw new EarPluginException( "Exception while opening file[" + destinationFile.getAbsolutePath() + "]", ex ); } } protected XMLWriter initializeXmlWriter( final Writer writer, final String docType ) { return new PrettyPrintXMLWriter( writer, encoding, docType ); } protected void close( Writer closeable ) { if ( closeable == null ) { return; } try { closeable.close(); } catch ( Exception e ) { // TODO: warn } } public String getEncoding() { return encoding; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java0000644000175000017500000002042511152525671030656 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.ear.util.ArtifactRepository; import org.codehaus.plexus.util.xml.XMLWriter; import java.util.Set; /** * A base implementation of an {@link EarModule}. * * @author Stephane Nicoll * @version $Id: AbstractEarModule.java 749046 2009-03-01 15:37:29Z snicoll $ */ public abstract class AbstractEarModule implements EarModule { protected static final String MODULE_ELEMENT = "module"; protected static final String JAVA_MODULE = "java"; protected static final String ALT_DD = "alt-dd"; private String uri; private Artifact artifact; // Those are set by the configuration private String groupId; private String artifactId; private String classifier; protected String bundleDir; protected String bundleFileName; protected Boolean excluded = Boolean.FALSE; protected Boolean unpack = null; protected String altDeploymentDescriptor; /** * Empty constructor to be used when the module * is built based on the configuration. */ public AbstractEarModule() { } /** * Creates an ear module from the artifact. * * @param a the artifact */ public AbstractEarModule( Artifact a ) { this.artifact = a; this.groupId = a.getGroupId(); this.artifactId = a.getArtifactId(); this.classifier = a.getClassifier(); this.bundleDir = null; } public void resolveArtifact( Set artifacts ) throws EarPluginException, MojoFailureException { // If the artifact is already set no need to resolve it if ( artifact == null ) { // Make sure that at least the groupId and the artifactId are specified if ( groupId == null || artifactId == null ) { throw new MojoFailureException( "Could not resolve artifact[" + groupId + ":" + artifactId + ":" + getType() + "]" ); } final ArtifactRepository ar = EarExecutionContext.getInstance().getArtifactRepository(); artifact = ar.getUniqueArtifact( groupId, artifactId, getType(), classifier ); // Artifact has not been found if ( artifact == null ) { Set candidates = ar.getArtifacts( groupId, artifactId, getType() ); if ( candidates.size() > 1 ) { throw new MojoFailureException( "Artifact[" + this + "] has " + candidates.size() + " candidates, please provide a classifier." ); } else { throw new MojoFailureException( "Artifact[" + this + "] " + "is not a dependency of the project." ); } } } } public Artifact getArtifact() { return artifact; } public String getUri() { if ( uri == null ) { if ( getBundleDir() == null ) { uri = getBundleFileName(); } else { uri = getBundleDir() + getBundleFileName(); } } return uri; } /** * Returns the artifact's groupId. * * @return the group Id */ public String getGroupId() { return groupId; } /** * Returns the artifact's Id. * * @return the artifact Id */ public String getArtifactId() { return artifactId; } /** * Returns the artifact's classifier. * * @return the artifact classifier */ public String getClassifier() { return classifier; } /** * Returns the bundle directory. If null, the module * is bundled in the root of the EAR. * * @return the custom bundle directory */ public String getBundleDir() { if ( bundleDir != null ) { bundleDir = cleanBundleDir( bundleDir ); } return bundleDir; } /** * Returns the bundle file name. If null, the artifact's * file name is returned. * * @return the bundle file name */ public String getBundleFileName() { if ( bundleFileName == null ) { bundleFileName = EarExecutionContext.getInstance().getFileNameMapping().mapFileName( artifact ); } return bundleFileName; } /** * The alt-dd element specifies an optional URI to the post-assembly version * of the deployment descriptor file for a particular Java EE module. The URI * must specify the full pathname of the deployment descriptor file relative * to the application's root directory. * * @return the alternative deployment descriptor for this module */ public String getAltDeploymentDescriptor() { return altDeploymentDescriptor; } /** * Specify whether this module should be excluded or not. * * @return true if this module should be skipped, false otherwise */ public boolean isExcluded() { return excluded.booleanValue(); } public Boolean shouldUnpack() { return unpack; } /** * Writes the alternative deployment descriptor if necessary. * * @param writer the writer to use * @param version the java EE version in use */ protected void writeAltDeploymentDescriptor( XMLWriter writer, String version ) { if ( getAltDeploymentDescriptor() != null ) { writer.startElement( ALT_DD ); writer.writeText( getAltDeploymentDescriptor() ); writer.endElement(); } } public String toString() { StringBuffer sb = new StringBuffer(); sb.append( getType() ).append( ":" ).append( groupId ).append( ":" ).append( artifactId ); if ( classifier != null ) { sb.append( ":" ).append( classifier ); } if ( artifact != null ) { sb.append( ":" ).append( artifact.getVersion() ); } return sb.toString(); } /** * Cleans the bundle directory so that it might be used * properly. * * @param bundleDir the bundle directory to clean * @return the cleaned bundle directory */ static String cleanBundleDir( String bundleDir ) { if ( bundleDir == null ) { return bundleDir; } // Using slashes bundleDir = bundleDir.replace( '\\', '/' ); // Remove '/' prefix if any so that directory is a relative path if ( bundleDir.startsWith( "/" ) ) { bundleDir = bundleDir.substring( 1, bundleDir.length() ); } if ( bundleDir.length() > 0 && !bundleDir.endsWith( "/" ) ) { // Adding '/' suffix to specify a directory structure if it is not empty bundleDir = bundleDir + "/"; } return bundleDir; } /** * Specify if the objects are both null or both equal. * * @param first the first object * @param second the second object * @return true if parameters are either both null or equal */ static boolean areNullOrEqual( Object first, Object second ) { if ( first != null ) { return first.equals( second ); } else { return second == null; } } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/HarModule.java0000644000175000017500000000361610537340337027200 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.codehaus.plexus.util.xml.XMLWriter; /** * The {@link EarModule} implementation for a JBoss Hibernate archive. * * @author Stephane Nicoll * @version $Id: HarModule.java 485857 2006-12-11 20:34:39Z snicoll $ */ public class HarModule extends AbstractEarModule implements JbossEarModule { public HarModule() { } public HarModule( Artifact a ) { super( a ); } public void appendModule( XMLWriter writer, String version ) { // No entry is generated by this artifact ; it should be // defined in the jboss-app.xml. // See http://docs.jboss.org/jbossas/getting_started/v4/html/hibernate.html } public void appendJbossModule( XMLWriter writer, String version ) { writer.startElement( MODULE_ELEMENT ); writer.startElement( "har" ); writer.writeText( getUri() ); writer.endElement(); writer.endElement(); } public String getType() { return "har"; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/SarModule.java0000644000175000017500000000416710537340337027215 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.codehaus.plexus.util.xml.XMLWriter; /** * The {@link EarModule} implementation for a JBoss sar module. * * @author Stephane Nicoll * @author $Author: snicoll $ (last edit) * @version $Revision: 485857 $ */ public class SarModule extends AbstractEarModule implements JbossEarModule { protected static final String SAR_MODULE = "connector"; public SarModule() { } public SarModule( Artifact a ) { super( a ); } public void appendModule( XMLWriter writer, String version ) { // If JBoss is not configured, add the module as a connector element if ( !EarExecutionContext.getInstance().isJbossConfigured() ) { writer.startElement( MODULE_ELEMENT ); writer.startElement( SAR_MODULE ); writer.writeText( getUri() ); writer.endElement(); writer.endElement(); } } public void appendJbossModule( XMLWriter writer, String version ) { writer.startElement( MODULE_ELEMENT ); writer.startElement( "service" ); writer.writeText( getUri() ); writer.endElement(); writer.endElement(); } public String getType() { return "sar"; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarMojo.java0000644000175000017500000004613211150271340026641 0ustar twernertwernerpackage 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.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProjectHelper; import org.apache.maven.shared.filtering.MavenFileFilter; import org.apache.maven.shared.filtering.MavenResourcesExecution; import org.apache.maven.shared.filtering.MavenFilteringException; import org.apache.maven.shared.filtering.MavenResourcesFiltering; import org.apache.maven.execution.MavenSession; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.UnArchiver; import org.codehaus.plexus.archiver.jar.JarArchiver; import org.codehaus.plexus.archiver.manager.ArchiverManager; import org.codehaus.plexus.archiver.manager.NoSuchArchiverException; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; /** * Builds J2EE Enteprise Archive (EAR) files. * * @author Stephane Nicoll * @version $Id: EarMojo.java 746740 2009-02-22 15:44:32Z snicoll $ * @goal ear * @phase package * @requiresDependencyResolution test */ public class EarMojo extends AbstractEarMojo { private static final String[] EMPTY_STRING_ARRAY = {}; /** * Single directory for extra files to include in the EAR. * * @parameter expression="${basedir}/src/main/application" * @required */ private File earSourceDirectory; /** * The comma separated list of tokens to include in the EAR. * * @parameter alias="includes" default-value="**" */ private String earSourceIncludes; /** * The comma separated list of tokens to exclude from the EAR. * * @parameter alias="excludes" */ private String earSourceExcludes; /** * Specify that the ear sources should be filtered. * * @parameter default-value="false" * @since 2.3.2 */ private boolean filtering; /** * Filters (property files) to include during the interpolation of the pom.xml. * * @parameter * @since 2.3.2 */ private List filters; /** * A list of file extensions that should not be filtered if * filtering is actived. * * @parameter * @since 2.3.2 */ private List nonFilteredFileExtensions; /** * To escape interpolated value with windows path * c:\foo\bar will be replaced with c:\\foo\\bar * * @parameter expression="${maven.ear.escapedBackslashesInFilePath}" default-value="false" * @since 2.3.2 */ private boolean escapedBackslashesInFilePath; /** * Expression preceded with the String won't be interpolated * \${foo} will be replaced with ${foo} * * @parameter expression="${maven.ear.escapeString}" * @since 2.3.2 */ protected String escapeString; /** * The location of the manifest file to be used within the ear file. * * @parameter expression="${basedir}/src/main/application/META-INF/MANIFEST.MF" */ private File manifestFile; /** * The location of a custom application.xml file to be used * within the ear file. * * @parameter */ private String applicationXml; /** * The directory for the generated EAR. * * @parameter expression="${project.build.directory}" * @required */ private String outputDirectory; /** * The name of the EAR file to generate. * * @parameter alias="earName" expression="${project.build.finalName}" * @required */ private String finalName; /** * The comma separated list of artifact's type(s) to unpack * by default. * * @parameter */ private String unpackTypes; /** * Classifier to add to the artifact generated. If given, the artifact will * be an attachment instead. * * @parameter */ private String classifier; /** * The directory to get the resources from. * * @parameter * @deprecated please use earSourcesDirectory instead */ private File resourcesDir; /** * The Jar archiver. * * @component role="org.codehaus.plexus.archiver.Archiver" role-hint="jar" */ private JarArchiver jarArchiver; /** * The archive configuration to use. * See Maven Archiver Reference. * * @parameter */ private MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); /** * @component */ private MavenProjectHelper projectHelper; /** * The archive manager. * * @component */ private ArchiverManager archiverManager; /** * * @component role="org.apache.maven.shared.filtering.MavenFileFilter" role-hint="default" * @required */ private MavenFileFilter mavenFileFilter; /** * * @component role="org.apache.maven.shared.filtering.MavenResourcesFiltering" role-hint="default" * @required */ private MavenResourcesFiltering mavenResourcesFiltering; /** * @parameter expression="${session}" * @readonly * @required * @since 2.3.2 */ private MavenSession session; private List filterWrappers; public void execute() throws MojoExecutionException, MojoFailureException { // Initializes ear modules super.execute(); // Initializes unpack types List unpackTypesList = new ArrayList(); if ( unpackTypes != null ) { unpackTypesList = Arrays.asList( unpackTypes.split( "," ) ); final Iterator it = unpackTypesList.iterator(); while ( it.hasNext() ) { String type = (String) it.next(); if ( !EarModuleFactory.standardArtifactTypes.contains( type ) ) { throw new MojoExecutionException( "Invalid type[" + type + "] supported types are " + EarModuleFactory.standardArtifactTypes ); } } getLog().debug( "Initialized unpack types " + unpackTypesList ); } // Copy modules try { for ( Iterator iter = getModules().iterator(); iter.hasNext(); ) { EarModule module = (EarModule) iter.next(); if ( module instanceof JavaModule ) { getLog().warn( "JavaModule is deprecated (" + module + "), please use JarModule instead." ); } if ( module instanceof Ejb3Module ) { getLog().warn( "Ejb3Module is deprecated (" + module + "), please use EjbModule instead." ); } final File sourceFile = module.getArtifact().getFile(); final File destinationFile = buildDestinationFile( getWorkDirectory(), module.getUri() ); if ( !sourceFile.isFile() ) { throw new MojoExecutionException( "Cannot copy a directory: " + sourceFile.getAbsolutePath() + "; Did you package/install " + module.getArtifact() + "?" ); } if ( destinationFile.getCanonicalPath().equals( sourceFile.getCanonicalPath() ) ) { getLog().info( "Skipping artifact[" + module + "], as it already exists at[" + module.getUri() + "]" ); continue; } // If the module is within the unpack list, make sure that no unpack wasn't forced (null or true) // If the module is not in the unpack list, it should be true if ( ( unpackTypesList.contains( module.getType() ) && ( module.shouldUnpack() == null || module.shouldUnpack().booleanValue() ) ) || ( module.shouldUnpack() != null && module.shouldUnpack().booleanValue() ) ) { getLog().info( "Copying artifact[" + module + "] to[" + module.getUri() + "] (unpacked)" ); // Make sure that the destination is a directory to avoid plexus nasty stuff :) destinationFile.mkdirs(); unpack( sourceFile, destinationFile ); } else { if ( sourceFile.lastModified() > destinationFile.lastModified() ) { getLog().info( "Copying artifact[" + module + "] to[" + module.getUri() + "]" ); FileUtils.copyFile( sourceFile, destinationFile ); } else { getLog().debug( "Skipping artifact[" + module + "], as it is already up to date at[" + module.getUri() + "]" ); } } } } catch ( IOException e ) { throw new MojoExecutionException( "Error copying EAR modules", e ); } catch ( ArchiverException e ) { throw new MojoExecutionException( "Error unpacking EAR modules", e ); } catch ( NoSuchArchiverException e ) { throw new MojoExecutionException( "No Archiver found for EAR modules", e ); } // Copy source files try { File earSourceDir = earSourceDirectory; if ( earSourceDir.exists() ) { getLog().info( "Copy ear sources to " + getWorkDirectory().getAbsolutePath() ); String[] fileNames = getEarFiles( earSourceDir ); for ( int i = 0; i < fileNames.length; i++ ) { copyFile( new File( earSourceDir, fileNames[i] ), new File( getWorkDirectory(), fileNames[i] ) ); } } if ( applicationXml != null && !"".equals( applicationXml ) ) { //rename to application.xml getLog().info( "Including custom application.xml[" + applicationXml + "]" ); File metaInfDir = new File( getWorkDirectory(), META_INF ); copyFile( new File( applicationXml ), new File( metaInfDir, "/application.xml" ) ); } } catch ( IOException e ) { throw new MojoExecutionException( "Error copying EAR sources", e ); } catch ( MavenFilteringException e ) { throw new MojoExecutionException( "Error filetering EAR sources", e ); } // Copy resources files try { if ( resourcesDir != null && resourcesDir.exists() ) { getLog().warn( "resourcesDir is deprecated. Please use the earSourceDirectory property instead."); getLog().info( "Copy ear resources to " + getWorkDirectory().getAbsolutePath() ); String[] fileNames = getEarFiles( resourcesDir ); for ( int i = 0; i < fileNames.length; i++ ) { FileUtils.copyFile( new File( resourcesDir, fileNames[i] ), new File( getWorkDirectory(), fileNames[i] ) ); } } } catch ( IOException e ) { throw new MojoExecutionException( "Error copying EAR resources", e ); } // Check if deployment descriptor is there File ddFile = new File( getWorkDirectory(), APPLICATION_XML_URI ); if ( !ddFile.exists() && !version.equals(VERSION_5 ) ) { throw new MojoExecutionException( "Deployment descriptor: " + ddFile.getAbsolutePath() + " does not exist." ); } try { File earFile = getEarFile( outputDirectory, finalName, classifier ); MavenArchiver archiver = new MavenArchiver(); final JarArchiver jarArchiver = getJarArchiver(); getLog().debug( "Jar archiver implementation[" + jarArchiver.getClass().getName() + "]" ); archiver.setArchiver( jarArchiver ); archiver.setOutputFile( earFile ); // Include custom manifest if necessary includeCustomManifestFile(); archiver.getArchiver().addDirectory( getWorkDirectory() ); archiver.createArchive( getProject(), archive ); if ( classifier != null ) { projectHelper.attachArtifact( getProject(), "ear", classifier, earFile ); } else { getProject().getArtifact().setFile( earFile ); } } catch ( Exception e ) { throw new MojoExecutionException( "Error assembling EAR", e ); } } public String getApplicationXml() { return applicationXml; } public void setApplicationXml( String applicationXml ) { this.applicationXml = applicationXml; } /** * Returns a string array of the excludes to be used * when assembling/copying the ear. * * @return an array of tokens to exclude */ protected String[] getExcludes() { List excludeList = new ArrayList( FileUtils.getDefaultExcludesAsList() ); if ( earSourceExcludes != null && !"".equals( earSourceExcludes ) ) { excludeList.addAll( Arrays.asList( StringUtils.split( earSourceExcludes, "," ) ) ); } // if applicationXml is specified, omit the one in the source directory if ( getApplicationXml() != null && !"".equals( getApplicationXml() ) ) { excludeList.add( "**/" + META_INF + "/application.xml" ); } return (String[]) excludeList.toArray( EMPTY_STRING_ARRAY ); } /** * Returns a string array of the includes to be used * when assembling/copying the ear. * * @return an array of tokens to include */ protected String[] getIncludes() { return StringUtils.split( StringUtils.defaultString( earSourceIncludes ), "," ); } private static File buildDestinationFile( File buildDir, String uri ) { return new File( buildDir, uri ); } private void includeCustomManifestFile() { File customManifestFile = manifestFile; if ( !customManifestFile.exists() ) { getLog().info( "Could not find manifest file: " + manifestFile + " - Generating one" ); } else { getLog().info( "Including custom manifest file[" + customManifestFile + "]" ); archive.setManifestFile( customManifestFile ); } } /** * Returns the EAR file to generate, based on an optional classifier. * * @param basedir the output directory * @param finalName the name of the ear file * @param classifier an optional classifier * @return the EAR file to generate */ private static File getEarFile( String basedir, String finalName, String classifier ) { if ( classifier == null ) { classifier = ""; } else if ( classifier.trim().length() > 0 && !classifier.startsWith( "-" ) ) { classifier = "-" + classifier; } return new File( basedir, finalName + classifier + ".ear" ); } /** * Returns a list of filenames that should be copied * over to the destination directory. * * @param sourceDir the directory to be scanned * @return the array of filenames, relative to the sourceDir */ private String[] getEarFiles( File sourceDir ) { DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir( sourceDir ); scanner.setExcludes( getExcludes() ); scanner.addDefaultExcludes(); scanner.setIncludes( getIncludes() ); scanner.scan(); return scanner.getIncludedFiles(); } /** * Unpacks the module into the EAR structure. * * @param source File to be unpacked. * @param destDir Location where to put the unpacked files. */ public void unpack( File source, File destDir ) throws NoSuchArchiverException, IOException, ArchiverException { UnArchiver unArchiver = archiverManager.getUnArchiver( "zip" ); unArchiver.setSourceFile( source ); unArchiver.setDestDirectory( destDir ); // Extract the module unArchiver.extract(); } /** * Returns the {@link JarArchiver} implementation used * to package the EAR file. *

* By default the archiver is obtained from the Plexus container. * * @return the archiver */ protected JarArchiver getJarArchiver() { return jarArchiver; } private void copyFile(File source, File target) throws MavenFilteringException, IOException, MojoExecutionException { if ( filtering && !isNonFilteredExtension( source.getName() ) ) { mavenFileFilter.copyFile( source, target, true, getFilterWrappers(), null ); } else { FileUtils.copyFile(source,target); } } public boolean isNonFilteredExtension( String fileName ) { return !mavenResourcesFiltering.filteredFileExtension( fileName, nonFilteredFileExtensions ); } private List getFilterWrappers() throws MojoExecutionException { if (filterWrappers == null) { try { MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(); mavenResourcesExecution.setEscapeString( escapeString ); filterWrappers = mavenFileFilter.getDefaultFilterWrappers( project, filters, escapedBackslashesInFilePath, this.session, mavenResourcesExecution ); } catch ( MavenFilteringException e ) { getLog().error( "fail to build filering wrappers " + e.getMessage() ); throw new MojoExecutionException( e.getMessage(), e ); } } return filterWrappers; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java0000644000175000017500000002741411150275561030340 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.ear.util.ArtifactTypeMappingService; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.configuration.PlexusConfiguration; import org.codehaus.plexus.configuration.PlexusConfigurationException; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; /** * A base class for EAR-processing related tasks. * * @author Stephane Nicoll * @version $Id: AbstractEarMojo.java 746754 2009-02-22 16:21:05Z snicoll $ */ public abstract class AbstractEarMojo extends AbstractMojo { public static final String VERSION_1_3 = "1.3"; public static final String VERSION_1_4 = "1.4"; public static final String VERSION_5 = "5"; public static final String APPLICATION_XML_URI = "META-INF/application.xml"; public static final String META_INF = "META-INF"; public static final String UTF_8 = "UTF-8"; /** * The version of the application.xml to generate. Valid values * are 1.3, 1.4 and 5. * * @parameter default-value="1.3" */ protected String version; /** * Character encoding for the auto-generated deployment file(s). * * @parameter default-value="UTF-8" */ protected String encoding; /** * Directory where the deployment descriptor file(s) will be auto-generated. * * @parameter expression="${project.build.directory}" */ protected String generatedDescriptorLocation; /** * The maven project. * * @parameter expression="${project}" * @required * @readonly */ protected MavenProject project; /** * The ear modules configuration. * * @parameter */ private EarModule[] modules; /** * The artifact type mappings. * * @parameter */ protected PlexusConfiguration artifactTypeMappings; /** * The default bundle dir for libraries. * * @parameter alias="defaultJavaBundleDir" */ protected String defaultLibBundleDir; /** * Should libraries be added in application.xml * * @parameter default-value="false" */ private Boolean includeLibInApplicationXml = Boolean.FALSE; /** * The file name mapping to use for all dependencies included * in the EAR file. * * @parameter */ private String fileNameMapping; /** * Directory that resources are copied to during the build. * * @parameter expression="${project.build.directory}/${project.build.finalName}" * @required */ private File workDirectory; /** * The JBoss specific configuration. * * @parameter */ private PlexusConfiguration jboss; /** * The id to use to define the main artifact (e.g. the artifact without * a classifier) when there is multiple candidates. * * @parameter */ private String mainArtifactId = "none"; private List earModules; private List allModules; private JbossConfiguration jbossConfiguration; public void execute() throws MojoExecutionException, MojoFailureException { getLog().debug( "Resolving artifact type mappings ..." ); try { ArtifactTypeMappingService.getInstance().configure( artifactTypeMappings ); } catch ( EarPluginException e ) { throw new MojoExecutionException( "Failed to initialize artifact type mappings", e ); } catch ( PlexusConfigurationException e ) { throw new MojoExecutionException( "Invalid artifact type mappings configuration", e ); } getLog().debug( "Initializing JBoss configuration if necessary ..." ); try { initializeJbossConfiguration(); } catch ( EarPluginException e ) { throw new MojoExecutionException( "Failed to initialize JBoss configuration", e ); } getLog().debug( "Initializing ear execution context" ); EarExecutionContext.getInstance().initialize( project, mainArtifactId, defaultLibBundleDir, jbossConfiguration, fileNameMapping ); getLog().debug( "Resolving ear modules ..." ); allModules = new ArrayList(); try { if ( modules != null && modules.length > 0 ) { // Let's validate user-defined modules EarModule module = null; for ( int i = 0; i < modules.length; i++ ) { module = modules[i]; getLog().debug( "Resolving ear module[" + module + "]" ); module.resolveArtifact( project.getArtifacts() ); allModules.add( module ); } } // Let's add other modules Set artifacts = project.getArtifacts(); for ( Iterator iter = artifacts.iterator(); iter.hasNext(); ) { Artifact artifact = (Artifact) iter.next(); // If the artifact's type is POM, ignore and continue // since it's used for transitive deps only. if ( "pom".equals( artifact.getType() ) ) { continue; } // Artifact is not yet registered and it has neither test, nor a // provided scope, not is it optional ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME ); if ( !isArtifactRegistered( artifact, allModules ) && !artifact.isOptional() && filter.include( artifact ) ) { EarModule module = EarModuleFactory.newEarModule( artifact, defaultLibBundleDir, includeLibInApplicationXml ); allModules.add( module ); } } } catch ( EarPluginException e ) { throw new MojoExecutionException( "Failed to initialize ear modules", e ); } // Now we have everything let's built modules which have not been excluded earModules = new ArrayList(); for ( Iterator iter = allModules.iterator(); iter.hasNext(); ) { EarModule earModule = (EarModule) iter.next(); if ( earModule.isExcluded() ) { getLog().debug( "Skipping ear module[" + earModule + "]" ); } else { earModules.add( earModule ); } } } protected List getModules() { if ( earModules == null ) { throw new IllegalStateException( "Ear modules have not been initialized" ); } return earModules; } protected MavenProject getProject() { return project; } protected File getWorkDirectory() { return workDirectory; } protected JbossConfiguration getJbossConfiguration() { return jbossConfiguration; } private static boolean isArtifactRegistered( Artifact a, List currentList ) { Iterator i = currentList.iterator(); while ( i.hasNext() ) { EarModule em = (EarModule) i.next(); if ( em.getArtifact().equals( a ) ) { return true; } } return false; } /** * Initializes the JBoss configuration. * * @throws EarPluginException if the configuration is invalid */ private void initializeJbossConfiguration() throws EarPluginException { if ( jboss == null ) { jbossConfiguration = null; } else { try { String version = jboss.getChild( JbossConfiguration.VERSION ).getValue(); if ( version == null ) { getLog().info( "JBoss version not set, using JBoss 4 by default" ); version = JbossConfiguration.VERSION_4; } final String securityDomain = jboss.getChild( JbossConfiguration.SECURITY_DOMAIN ).getValue(); final String unauthenticatedPrincipal = jboss.getChild( JbossConfiguration.UNAUHTHENTICTED_PRINCIPAL ).getValue(); final PlexusConfiguration loaderRepositoryEl = jboss.getChild( JbossConfiguration.LOADER_REPOSITORY ); final String loaderRepository = loaderRepositoryEl.getValue(); final String loaderRepositoryClass = loaderRepositoryEl.getAttribute( JbossConfiguration.LOADER_REPOSITORY_CLASS_ATTRIBUTE ); final PlexusConfiguration loaderRepositoryConfigEl = jboss.getChild( JbossConfiguration.LOADER_REPOSITORY_CONFIG ); final String loaderRepositoryConfig = loaderRepositoryConfigEl.getValue(); final String configParserClass = loaderRepositoryConfigEl.getAttribute( JbossConfiguration.CONFIG_PARSER_CLASS_ATTRIBUTE ); final String jmxName = jboss.getChild( JbossConfiguration.JMX_NAME ).getValue(); final String moduleOrder = jboss.getChild( JbossConfiguration.MODULE_ORDER ).getValue(); final List dataSources = new ArrayList(); final PlexusConfiguration dataSourcesEl = jboss.getChild( JbossConfiguration.DATASOURCES ); if ( dataSourcesEl != null ) { final PlexusConfiguration[] dataSourcesConfig = dataSourcesEl.getChildren( JbossConfiguration.DATASOURCE ); for ( int i = 0; i < dataSourcesConfig.length; i++ ) { PlexusConfiguration dataSourceConfig = dataSourcesConfig[i]; dataSources.add( dataSourceConfig.getValue() ); } } final String libraryDirectory = jboss.getChild( JbossConfiguration.LIBRARY_DIRECTORY ).getValue(); jbossConfiguration = new JbossConfiguration( version, securityDomain, unauthenticatedPrincipal, jmxName, loaderRepository, moduleOrder, dataSources, libraryDirectory, loaderRepositoryConfig, loaderRepositoryClass, configParserClass ); } catch ( PlexusConfigurationException e ) { throw new EarPluginException( "Invalid JBoss configuration", e ); } } } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/JbossEarModule.java0000644000175000017500000000261310537340337030172 0ustar twernertwernerpackage 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.xml.XMLWriter; /** * Represents a JBoss specific ear module. * * @author Stephane Nicoll * @version $Id: JbossEarModule.java 485857 2006-12-11 20:34:39Z snicoll $ */ public interface JbossEarModule { /** * Appends the XML representation of this module for * the jboss-app.xml file. * * @param writer the writer to use * @param version the version of the jboss-app.xml file */ public void appendJbossModule( XMLWriter writer, String version ); } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/ParModule.java0000644000175000017500000000244311123544663027205 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; /** * The {@link EarModule} implementation for a Par module. * * @author Stephane Nicoll * @author $Author: bentmann $ (last edit) * @version $Revision: 728546 $ */ public class ParModule extends EjbModule { public ParModule() { super(); } public ParModule( Artifact a ) { super( a ); } public String getType() { return "par"; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java0000644000175000017500000000265111127633454027250 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; /** * The {@link EarModule} implementation for an Ejb3 module. * * @author Stephane Nicoll * @author $Author: snicoll $ (last edit) * @version $Revision: 730956 $ * * @deprecated ejb v3 is now properly handled by the standard * ejb packaging type. use {@link EjbModule} instead */ public class Ejb3Module extends EjbModule { public Ejb3Module() { super(); } public Ejb3Module( Artifact a ) { super( a ); } public String getType() { return "ejb3"; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/WebModule.java0000644000175000017500000000654011123544663027202 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.util.xml.XMLWriter; import java.util.Set; /** * The {@link EarModule} implementation for a Web application module. * * @author Stephane Nicoll * @version $Id: WebModule.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class WebModule extends AbstractEarModule { protected static final String WEB_MODULE = "web"; protected static final String WEB_URI_FIELD = "web-uri"; protected static final String CONTEXT_ROOT_FIELD = "context-root"; private String contextRoot; public WebModule() { } public WebModule( Artifact a ) { super( a ); this.contextRoot = getDefaultContextRoot( a ); } public void appendModule( XMLWriter writer, String version ) { writer.startElement( MODULE_ELEMENT ); writer.startElement( WEB_MODULE ); writer.startElement( WEB_URI_FIELD ); writer.writeText( getUri() ); writer.endElement(); // web-uri writer.startElement( CONTEXT_ROOT_FIELD ); writer.writeText( getContextRoot() ); writer.endElement(); // context-root writer.endElement(); // web writeAltDeploymentDescriptor( writer, version); writer.endElement(); // module } public void resolveArtifact( Set artifacts ) throws EarPluginException, MojoFailureException { // Let's resolve the artifact super.resolveArtifact( artifacts ); // Context root has not been customized - using default if ( contextRoot == null ) { contextRoot = getDefaultContextRoot( getArtifact() ); } } /** * Returns the context root to use for the web module. *

* Note that this might return null till the * artifact has been resolved. * * @return the context root */ public String getContextRoot() { return contextRoot; } public String getType() { return "war"; } /** * Generates a default context root for the given artifact, based * on the artifactId. * * @param a the artifact * @return a context root for the artifact */ private static String getDefaultContextRoot( Artifact a ) { if ( a == null ) { throw new NullPointerException( "Artifact could not be null." ); } return "/" + a.getArtifactId(); } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/JbossAppXmlWriter.java0000644000175000017500000001671211150266035030712 0ustar twernertwernerpackage 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.xml.XMLWriter; import java.io.File; import java.io.Writer; import java.util.Iterator; import java.util.List; /** * An XmlWriter based implementation used to generate a * jboss-app.xml file * * @author Stephane Nicoll * @version $Id: JbossAppXmlWriter.java 746726 2009-02-22 15:15:41Z snicoll $ */ final class JbossAppXmlWriter extends AbstractXmlWriter { public static final String DOCTYPE_3_2 = "jboss-app PUBLIC\n" + "\t\"-//JBoss//DTD J2EE Application 1.3//EN\"\n" + "\t\"http://www.jboss.org/j2ee/dtd/jboss-app_3_2.dtd\""; public static final String DOCTYPE_4 = "jboss-app PUBLIC\n" + "\t\"-//JBoss//DTD J2EE Application 1.4//EN\"\n" + "\t\"http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd\""; public static final String DOCTYPE_4_2 = "jboss-app PUBLIC\n" + "\t\"-//JBoss//DTD J2EE Application 1.4//EN\"\n" + "\t\"http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd\""; public static final String DOCTYPE_5 = "jboss-app PUBLIC\n" + "\t\"-//JBoss//DTD Java EE Application 5.0//EN\"\n" + "\t\"http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd\""; private static final String JBOSS_APP_ELEMENT = "jboss-app"; JbossAppXmlWriter( String encoding ) { super( encoding ); } public void write( File destinationFile, JbossConfiguration jbossConfiguration, List earModules ) throws EarPluginException { final Writer w = initializeWriter( destinationFile ); XMLWriter writer; if ( jbossConfiguration.isJbossThreeDotTwo() ) { writer = initializeXmlWriter( w, DOCTYPE_3_2 ); } else if ( jbossConfiguration.isJbossFour() ) { writer = initializeXmlWriter( w, DOCTYPE_4 ); } else if ( jbossConfiguration.isJbossFourDotTwo() ) { writer = initializeXmlWriter( w, DOCTYPE_4_2 ); } else { writer = initializeXmlWriter( w, DOCTYPE_5 ); } writer.startElement( JBOSS_APP_ELEMENT ); // If JBoss 4.2 or 5.0, write the JBoss 4.2 and JBoss 5.0-compatible stuff if ( jbossConfiguration.isJbossFourDotTwo() || jbossConfiguration.isJbossFive() ) { // library-directory if ( jbossConfiguration.getLibraryDirectory() != null ) { writer.startElement( JbossConfiguration.LIBRARY_DIRECTORY ); writer.writeText ( jbossConfiguration.getLibraryDirectory() ); writer.endElement(); } } // If JBoss 4.2, write the jboss4.2 specific stuff if ( jbossConfiguration.isJbossFourDotTwo() ) { // module-order (only available in 4.2 and 4.3) if ( jbossConfiguration.getModuleOrder() != null ) { writer.startElement( JbossConfiguration.MODULE_ORDER ); writer.writeText( jbossConfiguration.getModuleOrder() ); writer.endElement(); } } // If JBoss 4, write the jboss4 specific stuff if ( jbossConfiguration.isJbossFour() || jbossConfiguration.isJbossFourDotTwo() ) { if ( jbossConfiguration.getSecurityDomain() != null ) { writer.startElement( JbossConfiguration.SECURITY_DOMAIN ); writer.writeText( jbossConfiguration.getSecurityDomain() ); writer.endElement(); } if ( jbossConfiguration.getUnauthenticatedPrincipal() != null ) { writer.startElement( JbossConfiguration.UNAUHTHENTICTED_PRINCIPAL ); writer.writeText( jbossConfiguration.getUnauthenticatedPrincipal() ); writer.endElement(); } } // classloader repository if ( jbossConfiguration.getLoaderRepository() != null || jbossConfiguration.getLoaderRepositoryConfig() != null) { writer.startElement( JbossConfiguration.LOADER_REPOSITORY ); // classloader repository class if ( jbossConfiguration.getLoaderRepositoryClass() != null) { writer.addAttribute( JbossConfiguration.LOADER_REPOSITORY_CLASS_ATTRIBUTE, jbossConfiguration.getLoaderRepositoryClass() ); } // we don't need to write any text if only the loader repo configuration is changed if ( jbossConfiguration.getLoaderRepository() != null ) { writer.writeText( jbossConfiguration.getLoaderRepository() ); } // classloader configuration if ( jbossConfiguration.getLoaderRepositoryConfig() != null ) { writer.startElement( JbossConfiguration.LOADER_REPOSITORY_CONFIG ); // classloader configuration parser if ( jbossConfiguration.getConfigParserClass() != null) { writer.addAttribute( JbossConfiguration.CONFIG_PARSER_CLASS_ATTRIBUTE, jbossConfiguration.getConfigParserClass() ); } writer.writeText( jbossConfiguration.getLoaderRepositoryConfig() ); writer.endElement(); } writer.endElement(); } // jmx name if ( jbossConfiguration.getJmxName() != null ) { writer.startElement( JbossConfiguration.JMX_NAME ); writer.writeText( jbossConfiguration.getJmxName() ); writer.endElement(); } List dataSources = jbossConfiguration.getDataSources(); // Write out data source modules first if ( dataSources != null ) { final Iterator it = dataSources.iterator(); while ( it.hasNext() ) { String dsPath = (String) it.next(); writer.startElement( MODULE_ELEMENT ); writer.startElement( SERVICE_ELEMENT ); writer.writeText( dsPath ); writer.endElement(); writer.endElement(); } } // Write the JBoss specific modules final Iterator it = earModules.iterator(); while ( it.hasNext() ) { EarModule earModule = (EarModule) it.next(); if ( JbossEarModule.class.isInstance( earModule ) ) { JbossEarModule jbossEarModule = (JbossEarModule) earModule; jbossEarModule.appendJbossModule( writer, jbossConfiguration.getVersion() ); } } writer.endElement(); close( w ); } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EjbModule.java0000644000175000017500000000331211123544663027157 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.codehaus.plexus.util.xml.XMLWriter; /** * The {@link EarModule} implementation for an EJB module. * * @author Stephane Nicoll * @version $Id: EjbModule.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class EjbModule extends AbstractEarModule { protected static final String EJB_MODULE = "ejb"; public EjbModule() { } public EjbModule( Artifact a ) { super( a ); } public void appendModule( XMLWriter writer, String version ) { writer.startElement( MODULE_ELEMENT ); writer.startElement( EJB_MODULE ); writer.writeText( getUri() ); writer.endElement(); writeAltDeploymentDescriptor( writer, version); writer.endElement(); } public String getType() { return "ejb"; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/SecurityRole.java0000644000175000017500000000677511123544663027762 0ustar twernertwernerpackage 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.xml.XMLWriter; /** * The representation of a security-role entry within an * application.xml file. * * @author Stephane Nicoll * @version $Id: SecurityRole.java 728546 2008-12-21 22:56:51Z bentmann $ */ class SecurityRole { protected static final String SECURITY_ROLE = "security-role"; protected static final String ID_ATTRIBUTE = "id"; protected static final String DESCRIPTION = "description"; protected static final String ROLE_NAME = "role-name"; private final String roleName; private final String roleNameId; private final String roleId; private final String description; private final String descriptionId; public SecurityRole( String roleName, String roleNameId, String roleId, String description, String descriptionId ) { if ( roleName == null ) { throw new NullPointerException( "role-name in security-role element could not be null." ); } this.roleName = roleName; this.roleNameId = roleNameId; this.roleId = roleId; this.description = description; this.descriptionId = descriptionId; } public String getRoleName() { return roleName; } public String getRoleNameId() { return roleNameId; } public String getRoleId() { return roleId; } public String getDescription() { return description; } public String getDescriptionId() { return descriptionId; } /** * Appends the XML representation of this security role. * * @param writer the writer to use */ public void appendSecurityRole( XMLWriter writer ) { writer.startElement( SECURITY_ROLE ); // role id if ( getRoleId() != null ) { writer.addAttribute( ID_ATTRIBUTE, getRoleId() ); } // description if ( getDescription() != null ) { writer.startElement( DESCRIPTION ); if ( getDescriptionId() != null ) { writer.addAttribute( ID_ATTRIBUTE, getDescriptionId() ); } writer.writeText( getDescription() ); writer.endElement(); } // role name writer.startElement( ROLE_NAME ); if ( getRoleNameId() != null ) { writer.addAttribute( ID_ATTRIBUTE, getRoleNameId() ); } writer.writeText( getRoleName() ); writer.endElement(); // end of security-role writer.endElement(); } public String toString() { return "Security role " + getRoleName(); } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/output/0000755000175000017500000000000011241314103025770 5ustar twernertwernermaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/output/FullFileNameMapping.java0000644000175000017500000000257410537340337032501 0ustar twernertwernerpackage org.apache.maven.plugin.ear.output; /* * 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.apache.maven.artifact.Artifact; /** * A full file name mapping, useful if artifacts might have the same * name accross groups. * * @author Stephane Nicoll * @version $Id: FullFileNameMapping.java 485857 2006-12-11 20:34:39Z snicoll $ */ public class FullFileNameMapping implements FileNameMapping { public String mapFileName( final Artifact a ) { final String dashedGroupId = a.getGroupId().replace( '.', '-'); return dashedGroupId + "-" + a.getFile().getName(); } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/output/StandardFileNameMapping.javamaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/output/StandardFileNameMapping.java0000644000175000017500000000244410537340337033333 0ustar twernertwernerpackage org.apache.maven.plugin.ear.output; /* * 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.apache.maven.artifact.Artifact; /** * The standard fine name mapping. It returns the name * of the file in the local repository. * * @author Stephane Nicoll * @version $Id: StandardFileNameMapping.java 485857 2006-12-11 20:34:39Z snicoll $ */ public class StandardFileNameMapping implements FileNameMapping { public String mapFileName( final Artifact a ) { return a.getFile().getName(); } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/output/FileNameMapping.java0000644000175000017500000000257710537340337031661 0ustar twernertwernerpackage org.apache.maven.plugin.ear.output; /* * 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.apache.maven.artifact.Artifact; /** * Maps file name {@link Artifact}. *

* TODO: it might be easier to use a token-based approach instead. * * @author Stephane Nicoll * @version $Id: FileNameMapping.java 485857 2006-12-11 20:34:39Z snicoll $ */ public interface FileNameMapping { /** * Returns the file name of the specified artifact. * * @param a the artifact * @return the name of the file for the specified artifact */ String mapFileName(final Artifact a); } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/output/FileNameMappingFactory.java0000644000175000017500000000757010537340337033207 0ustar twernertwernerpackage org.apache.maven.plugin.ear.output; /* * 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 java.util.HashMap; import java.util.Map; /** * Provides access to {@link FileNameMapping} implementations. *

* Two basic implementations are provided by default: *

    *
  • standard: the default implementation
  • *
  • full: an implementation that maps to a 'full' file name, i.e. containing the groupId
  • *
* * @author Stephane Nicoll * @version $Id: FileNameMappingFactory.java 485857 2006-12-11 20:34:39Z snicoll $ */ public class FileNameMappingFactory { public static final String STANDARD_FILE_NAME_MAPPING = "standard"; public static final String FULL_FILE_NAME_MAPPING = "full"; public static final FileNameMappingFactory INSTANCE = new FileNameMappingFactory(); private final Map mappings; private FileNameMappingFactory() { mappings = new HashMap(); mappings.put( STANDARD_FILE_NAME_MAPPING, new StandardFileNameMapping() ); mappings.put( FULL_FILE_NAME_MAPPING, new FullFileNameMapping() ); } public FileNameMapping getDefaultFileNameMapping() { return getFileNameMapping( STANDARD_FILE_NAME_MAPPING ); } /** * Returns the file name mapping implementation based on a logical name * of a fully qualified name of the class. * * @param nameOrClass a name of the fqn of the implementation * @return the file name mapping implementation * @throws IllegalStateException if the implementation is not found */ public FileNameMapping getFileNameMapping( final String nameOrClass ) throws IllegalStateException { // Check if it's there yet if ( mappings.containsKey( nameOrClass ) ) { return (FileNameMapping) mappings.get( nameOrClass ); } else { try { final Class c = Class.forName( nameOrClass ); final FileNameMapping fnm = (FileNameMapping) c.newInstance(); mappings.put( nameOrClass, fnm ); return fnm; } catch ( ClassNotFoundException e ) { throw new IllegalStateException( "File name mapping implementation[" + nameOrClass + "] was not found " + e.getMessage() ); } catch ( InstantiationException e ) { throw new IllegalStateException( "Could not instanciate file name mapping implementation[" + nameOrClass + "] make sure it has a default public constructor" ); } catch ( IllegalAccessException e ) { throw new IllegalStateException( "Could not access file name mapping implementation[" + nameOrClass + "] make sure it has a default public constructor" ); } catch ( ClassCastException e ) { throw new IllegalStateException( "Specified class[" + nameOrClass + "] does not implement[" + FileNameMapping.class.getName() + "]" ); } } } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/util/0000755000175000017500000000000011241314103025405 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingService.javamaven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/util/ArtifactTypeMappingService.jav0000644000175000017500000001501211123544663033361 0ustar twernertwernerpackage org.apache.maven.plugin.ear.util; /* * 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.configuration.PlexusConfiguration; import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.apache.maven.plugin.ear.EarPluginException; import org.apache.maven.plugin.ear.EarModuleFactory; import org.apache.maven.plugin.ear.UnknownArtifactTypeException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Allows to map custom artifact type to standard type. * * @author Stephane Nicoll * @version $Id: ArtifactTypeMappingService.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class ArtifactTypeMappingService { static final String ARTIFACT_TYPE_MAPPING_ELEMENT = "artifactTypeMapping"; static final String TYPE_ATTRIBUTE = "type"; static final String MAPPING_ATTRIBUTE = "mapping"; private static final ArtifactTypeMappingService INSTANCE = new ArtifactTypeMappingService(); public static ArtifactTypeMappingService getInstance() { return INSTANCE; } // A standard type to a list of customType private final Map typeMappings; // The user-defined mapping for direct access private final Map customMappings; private ArtifactTypeMappingService() { this.typeMappings = new HashMap(); this.customMappings = new HashMap(); } public void configure( final PlexusConfiguration plexusConfiguration ) throws EarPluginException, PlexusConfigurationException { // Initializes the typeMappings with default values init(); // No user defined configuration if ( plexusConfiguration == null ) { return; } // Inject users configuration final PlexusConfiguration[] artifactTypeMappings = plexusConfiguration.getChildren( ARTIFACT_TYPE_MAPPING_ELEMENT ); for ( int i = 0; i < artifactTypeMappings.length; i++ ) { PlexusConfiguration artifactTypeMapping = artifactTypeMappings[i]; final String customType = artifactTypeMapping.getAttribute( TYPE_ATTRIBUTE ); final String mapping = artifactTypeMapping.getAttribute( MAPPING_ATTRIBUTE ); if ( customType == null ) { throw new EarPluginException( "Invalid artifact type mapping, type attribute should be set." ); } else if ( mapping == null ) { throw new EarPluginException( "Invalid artifact type mapping, mapping attribute should be set." ); } else if ( !EarModuleFactory.isStandardArtifactType( mapping ) ) { throw new EarPluginException( "Invalid artifact type mapping, mapping[" + mapping + "] must be a standard Ear artifact type[" + EarModuleFactory.getStandardArtifactTypes() + "]" ); } else if ( customMappings.containsKey( customType ) ) { throw new EarPluginException( "Invalid artifact type mapping, type[" + customType + "] is already registered." ); } else { // Add the custom mapping customMappings.put( customType, mapping ); // Register the custom mapping to its standard type List typeMapping = (List) typeMappings.get( mapping ); typeMapping.add( customType ); } } } /** * Specify whether the customType could be mapped to the * standardType. * * @param standardType the standard type (ejb, jar, war, ...) * @param customType a user-defined type * @return true if the customType could be mapped to the standard type */ public boolean isMappedToType( final String standardType, final String customType ) { if ( !EarModuleFactory.isStandardArtifactType( standardType ) ) { throw new IllegalStateException( "Artifact type[" + standardType + "] is not a standard Ear artifact type[" + EarModuleFactory.getStandardArtifactTypes() + "]" ); } final List typeMappings = (List) this.typeMappings.get( standardType ); return typeMappings.contains( customType ); } /** * Returns the standard type for the specified type. If * the specified type is already a standard type, the orignal type * is returned. * * @param type a type * @return the standard type (ejb, jar, war, ...) for this type */ public String getStandardType( final String type ) throws UnknownArtifactTypeException { if ( type == null ) { throw new IllegalStateException( "custom type could not be null." ); } else if ( EarModuleFactory.getStandardArtifactTypes().contains( type ) ) { return type; } else if ( !customMappings.containsKey( type ) ) { throw new UnknownArtifactTypeException( "Unknown artifact type[" + type + "]" ); } else { return (String) customMappings.get( type ); } } private void init() { // Initialize the typeMappings typeMappings.clear(); // Clear the customMappings customMappings.clear(); // Initialize the mapping with the standard artifact types final Iterator it = EarModuleFactory.getStandardArtifactTypes().iterator(); while ( it.hasNext() ) { String type = (String) it.next(); List typeMapping = new ArrayList(); typeMapping.add( type ); this.typeMappings.put( type, typeMapping ); } } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/util/ArtifactRepository.java0000644000175000017500000001223510601246462032123 0ustar twernertwernerpackage org.apache.maven.plugin.ear.util; /* * 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.apache.maven.artifact.Artifact; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; /** * An artifact repository used to resolve {@link org.apache.maven.plugin.ear.EarModule}. * * @author Stephane Nicoll * @version $Id: ArtifactRepository.java 522047 2007-03-24 16:09:22Z snicoll $ */ public class ArtifactRepository { private final Set artifacts; private final String mainArtifactId; private final ArtifactTypeMappingService artifactTypeMappingService; /** * Creates a new repository wih the specified artifacts. * * @param artifacts the artifacts * @param mainArtifactId the id to use for the main artifact (no classifier) */ public ArtifactRepository( Set artifacts, String mainArtifactId ) { this.artifacts = artifacts; this.mainArtifactId = mainArtifactId; this.artifactTypeMappingService = ArtifactTypeMappingService.getInstance(); } /** * Returns the artifact with the specified parameters. *

* If the artifact is classified and is the only one with the specified * groupI, artifactId and type, it will be returned. *

* If the artifact is classified and is not the only one with the specified * groupI, artifactId and type, it returns null. *

* If the artifact is not found, it returns null. * * @param groupId the group id * @param artifactId the artifact id * @param type the type * @param classifier the classifier * @return the artifact or null if no artifact were found */ public Artifact getUniqueArtifact( String groupId, String artifactId, String type, String classifier ) { final Set candidates = getArtifacts( groupId, artifactId, type ); if ( candidates.size() == 0 ) { return null; } else if ( candidates.size() == 1 && classifier == null ) { return (Artifact) candidates.iterator().next(); } else if ( classifier != null ) { final Iterator it = candidates.iterator(); while ( it.hasNext() ) { Artifact a = (Artifact) it.next(); if ( a.getClassifier() == null && classifier.equals( mainArtifactId ) ) { return a; } else if ( classifier.equals( a.getClassifier() ) ) { return a; } } } // All other cases, classifier is null and more than one candidate ; artifact not found return null; } /** * Returns the artifact with the specified parameters. *

* If the artifact is classified and is the only one with the specified * groupI, artifactId and type, it will be returned. *

* If the artifact is classified and is not the only one with the specified * groupI, artifactId and type, it returns null. *

* If the artifact is not found, it returns null. * * @param groupId the group id * @param artifactId the artifact id * @param type the type * @return the artifact or null if no artifact were found */ public Artifact getUniqueArtifact( String groupId, String artifactId, String type ) { return getUniqueArtifact( groupId, artifactId, type, null ); } /** * Returns the artifacts with the specified parameters. * * @param groupId the group id * @param artifactId the artifact id * @param type the type * @return the artifacts or an empty set if no artifact were found */ public Set getArtifacts( String groupId, String artifactId, String type ) { final Set result = new TreeSet(); final Iterator it = artifacts.iterator(); while ( it.hasNext() ) { Artifact a = (Artifact) it.next(); // If the groupId, the artifactId and if the // artifact's type is known, then we have found a candidate. if ( a.getGroupId().equals( groupId ) && a.getArtifactId().equals( artifactId ) && artifactTypeMappingService.isMappedToType( type, a.getType() ) ) { result.add( a ); } } return result; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java0000644000175000017500000000270111150275561030315 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.codehaus.plexus.util.xml.XMLWriter; /** * The {@link EarModule} implementation for an ejb client module. * * @author Stephane Nicoll * @version $Id: EjbClientModule.java 746754 2009-02-22 16:21:05Z snicoll $ */ public class EjbClientModule extends JarModule { public EjbClientModule() { super(); } public EjbClientModule( Artifact a, String defaultLibBundleDir ) { super( a, defaultLibBundleDir, Boolean.FALSE ); } public String getType() { return "ejb-client"; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/RarModule.java0000644000175000017500000000334311123544663027207 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.codehaus.plexus.util.xml.XMLWriter; /** * The {@link EarModule} implementation for an J2EE connector module. * * @author Stephane Nicoll * @version $Id: RarModule.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class RarModule extends AbstractEarModule { protected static final String RAR_MODULE = "connector"; public RarModule() { } public RarModule( Artifact a ) { super( a ); } public void appendModule( XMLWriter writer, String version ) { writer.startElement( MODULE_ELEMENT ); writer.startElement( RAR_MODULE ); writer.writeText( getUri() ); writer.endElement(); writeAltDeploymentDescriptor( writer, version); writer.endElement(); } public String getType() { return "rar"; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java0000644000175000017500000001323711127602776031445 0ustar twernertwernerpackage 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.xml.XMLWriter; import java.io.File; import java.io.Writer; import java.util.Iterator; import java.util.List; /** * An XmlWriter based implementation used to generate an * application.xml file * * @author Stephane Nicoll * @version $Id: ApplicationXmlWriter.java 730922 2009-01-03 06:30:22Z snicoll $ */ final class ApplicationXmlWriter extends AbstractXmlWriter { public static final String DOCTYPE_1_3 = "application PUBLIC\n" + "\t\"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN\"\n" + "\t\"http://java.sun.com/dtd/application_1_3.dtd\""; private static final String APPLICATION_ELEMENT = "application"; private final String version; ApplicationXmlWriter( String version, String encoding ) { super( encoding ); this.version = version; } public void write( ApplicationXmlWriterContext context ) throws EarPluginException { Writer w = initializeWriter( context.getDestinationFile() ); XMLWriter writer = null; if ( GenerateApplicationXmlMojo.VERSION_1_3.equals( version ) ) { writer = initializeRootElementOneDotThree( w ); writeDisplayName( context.getDisplayName(), writer ); writeDescription( context.getDescription(), writer ); } else if ( GenerateApplicationXmlMojo.VERSION_1_4.equals( version ) ) { writer = initializeRootElementOneDotFour( w ); writeDescription( context.getDescription(), writer ); writeDisplayName( context.getDisplayName(), writer ); } else if ( GenerateApplicationXmlMojo.VERSION_5.equals( version ) ) { writer = initializeRootElementFive( w ); writeDescription( context.getDescription(), writer ); writeDisplayName( context.getDisplayName(), writer ); } final Iterator moduleIt = context.getEarModules().iterator(); while ( moduleIt.hasNext() ) { EarModule module = (EarModule) moduleIt.next(); module.appendModule( writer, version ); } final Iterator securityRoleIt = context.getSecurityRoles().iterator(); while ( securityRoleIt.hasNext() ) { SecurityRole securityRole = (SecurityRole) securityRoleIt.next(); securityRole.appendSecurityRole( writer ); } if ( GenerateApplicationXmlMojo.VERSION_5.equals( version ) ) { writeLibraryDirectory ( context.getLibraryDirectory(), writer ); } writer.endElement(); close( w ); } private void writeDescription( String description, XMLWriter writer ) { if ( description != null ) { writer.startElement( "description" ); writer.writeText( description ); writer.endElement(); } } private void writeDisplayName( String displayName, XMLWriter writer ) { if ( displayName != null ) { writer.startElement( "display-name" ); writer.writeText( displayName ); writer.endElement(); } } private void writeLibraryDirectory( String libraryDirectory, XMLWriter writer ) { if ( libraryDirectory != null ) { writer.startElement( "library-directory" ); writer.writeText( libraryDirectory ); writer.endElement(); } } private XMLWriter initializeRootElementOneDotThree( Writer w ) { XMLWriter writer = initializeXmlWriter( w, DOCTYPE_1_3 ); writer.startElement( APPLICATION_ELEMENT ); return writer; } private XMLWriter initializeRootElementOneDotFour( Writer w ) { XMLWriter writer = initializeXmlWriter( w, null ); writer.startElement( APPLICATION_ELEMENT ); writer.addAttribute( "xmlns", "http://java.sun.com/xml/ns/j2ee" ); writer.addAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" ); writer.addAttribute( "xsi:schemaLocation", "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" ); writer.addAttribute( "version", "1.4" ); return writer; } private XMLWriter initializeRootElementFive( Writer w ) { XMLWriter writer = initializeXmlWriter( w, null ); writer.startElement( APPLICATION_ELEMENT ); writer.addAttribute( "xmlns", "http://java.sun.com/xml/ns/javaee" ); writer.addAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" ); writer.addAttribute( "xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" ); writer.addAttribute( "version", "5" ); return writer; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModule.java0000644000175000017500000000670511123544663027177 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.util.xml.XMLWriter; import java.util.Set; /** * The ear module interface. * * @author Stephane Nicoll * @version $Id: EarModule.java 728546 2008-12-21 22:56:51Z bentmann $ */ public interface EarModule { /** * Returns the {@link Artifact} representing this module. *

* Note that this might return null till the * module has been resolved. * * @return the artifact * @see #resolveArtifact(java.util.Set) */ public Artifact getArtifact(); /** * Returns the URI for this module. * * @return the URI */ public String getUri(); /** * Returns the type associated to the module. * * @return the artifact's type of the module */ public String getType(); /** * Specify whether this module should be excluded or not. * * @return true if this module should be skipped, false otherwise */ public boolean isExcluded(); /** * Specify whether this module should be unpacked in the * EAR archive or not. *

* Returns null if no configuration was specified so that * defaulting may apply. * * @return true if this module should be bundled unpacked, false otherwise */ public Boolean shouldUnpack(); /** * The alt-dd element specifies an optional URI to the post-assembly version * of the deployment descriptor file for a particular Java EE module. The URI * must specify the full pathname of the deployment descriptor file relative * to the application's root directory. * * @return the alternative deployment descriptor for this module * * @since JavaEE 5 */ public String getAltDeploymentDescriptor(); /** * Appends the XML representation of this module. * * @param writer the writer to use * @param version the version of the application.xml file */ public void appendModule( XMLWriter writer, String version ); /** * Resolves the {@link Artifact} represented by the module. Note * that the {@link EarExecutionContext} might be used to customiz * further the resolution. * * @param artifacts the project's artifacts * @throws EarPluginException if the artifact could not be resolved * @throws MojoFailureException if an unexpected error occured */ public void resolveArtifact( Set artifacts ) throws EarPluginException, MojoFailureException; } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/JavaModule.java0000644000175000017500000000330211150275561027335 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; /** * The original {@link org.apache.maven.plugin.ear.EarModule} implementation * of a third party library. * * @author Stephane Nicoll * @version $Id: JavaModule.java 746754 2009-02-22 16:21:05Z snicoll $ * @deprecated the name JavaModule is really confusing since it targets a * third party library, use {@link JarModule} instead */ public class JavaModule extends JarModule { /** * @deprecated use {@link org.apache.maven.plugin.ear.JavaModule#JarModule()} instead */ public JavaModule() { super(); } /** * @deprecated use {@link JarModule} instead */ public JavaModule( Artifact a, String defaultLibBundleDir, Boolean includeInApplicationXml ) { super( a, defaultLibBundleDir, includeInApplicationXml ); } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarPluginException.java0000644000175000017500000000262111123544663031060 0ustar twernertwernerpackage 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. */ /** * The base exception of the EAR plugin. * * @author Stephane Nicoll * @version $Id: EarPluginException.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class EarPluginException extends Exception { public EarPluginException() { } public EarPluginException( String message ) { super( message ); } public EarPluginException( Throwable cause ) { super( cause ); } public EarPluginException( String message, Throwable cause ) { super( message, cause ); } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/GenerateApplicationXmlMojo.java0000644000175000017500000001746311150271340032536 0ustar twernertwernerpackage 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.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.configuration.PlexusConfiguration; import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * A Mojo that generates the EAR deployment descriptor file(s). * * @author Stephane Nicoll * @version $Id: GenerateApplicationXmlMojo.java 746740 2009-02-22 15:44:32Z snicoll $ * @goal generate-application-xml * @phase generate-resources * @requiresDependencyResolution test */ public class GenerateApplicationXmlMojo extends AbstractEarMojo { /** * Whether the application.xml should be generated or not. * * @parameter */ private Boolean generateApplicationXml = Boolean.TRUE; /** * Display name of the application to be used when application.xml * file is autogenerated. * * @parameter expression="${project.artifactId}" */ private String displayName; /** * Description of the application to be used when application.xml * file is autogenerated. * * @parameter expression="${project.description}" */ private String description; /** * The security-roles to be added to the auto-generated * application.xml file. * * @parameter */ private PlexusConfiguration security; public void execute() throws MojoExecutionException, MojoFailureException { // Initializes ear modules super.execute(); // Handle application.xml if ( !generateApplicationXml.booleanValue() ) { getLog().debug( "Generation of application.xml is disabled" ); } else { // Check version if ( !version.equals( VERSION_1_3 ) && !version.equals( VERSION_1_4 ) && !version.equals( VERSION_5 ) ) { throw new MojoExecutionException( "Invalid version[" + version + "]" ); } // Generate deployment descriptor and copy it to the build directory getLog().info( "Generating application.xml" ); try { generateStandardDeploymentDescriptor(); } catch ( EarPluginException e ) { throw new MojoExecutionException( "Failed to generate application.xml", e ); } try { FileUtils.copyFileToDirectory( new File( generatedDescriptorLocation, "application.xml" ), new File( getWorkDirectory(), "META-INF" ) ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to copy application.xml to final destination", e ); } } // Handle jboss-app.xml if ( getJbossConfiguration() == null ) { getLog().debug( "Generation of jboss-app.xml is disabled" ); return; } else { // Generate deployment descriptor and copy it to the build directory getLog().info( "Generating jboss-app.xml" ); try { generateJbossDeploymentDescriptor(); } catch ( EarPluginException e ) { throw new MojoExecutionException( "Failed to generate jboss-app.xml", e ); } try { FileUtils.copyFileToDirectory( new File( generatedDescriptorLocation, "jboss-app.xml" ), new File( getWorkDirectory(), "META-INF" ) ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to copy jboss-app.xml to final destination", e ); } } } /** * Generates the deployment descriptor. */ protected void generateStandardDeploymentDescriptor() throws EarPluginException { File outputDir = new File( generatedDescriptorLocation ); if ( !outputDir.exists() ) { outputDir.mkdirs(); } File descriptor = new File( outputDir, "application.xml" ); final ApplicationXmlWriter writer = new ApplicationXmlWriter( version, encoding ); final ApplicationXmlWriterContext context = new ApplicationXmlWriterContext(descriptor, getModules(), buildSecurityRoles(), displayName, description, defaultLibBundleDir); writer.write( context ); } /** * Generates the jboss deployment descriptor. */ protected void generateJbossDeploymentDescriptor() throws EarPluginException { File outputDir = new File( generatedDescriptorLocation ); if ( !outputDir.exists() ) { outputDir.mkdirs(); } File descriptor = new File( outputDir, "jboss-app.xml" ); JbossAppXmlWriter writer = new JbossAppXmlWriter( encoding ); writer.write( descriptor, getJbossConfiguration(), getModules() ); } /** * Builds the security roles based on the configuration. * * @return a list of SecurityRole object(s) * @throws EarPluginException if the configuration is invalid */ private List buildSecurityRoles() throws EarPluginException { final List result = new ArrayList(); if ( security == null ) { return result; } try { final PlexusConfiguration[] securityRoles = security.getChildren( SecurityRole.SECURITY_ROLE ); for ( int i = 0; i < securityRoles.length; i++ ) { PlexusConfiguration securityRole = securityRoles[i]; final String id = securityRole.getAttribute( SecurityRole.ID_ATTRIBUTE ); final String roleName = securityRole.getChild( SecurityRole.ROLE_NAME ).getValue(); final String roleNameId = securityRole.getChild( SecurityRole.ROLE_NAME ).getAttribute( SecurityRole.ID_ATTRIBUTE ); final String description = securityRole.getChild( SecurityRole.DESCRIPTION ).getValue(); final String descriptionId = securityRole.getChild( SecurityRole.DESCRIPTION ).getAttribute( SecurityRole.ID_ATTRIBUTE ); if ( roleName == null ) { throw new EarPluginException( "Invalid security-role configuration, role-name could not be null." ); } else { result.add( new SecurityRole( roleName, roleNameId, id, description, descriptionId ) ); } } return result; } catch ( PlexusConfigurationException e ) { throw new EarPluginException( "Invalid security-role configuration", e ); } } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/WsrModule.java0000644000175000017500000000242511123544663027236 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; /** * The {@link EarModule} implementation for a JBoss wsr module. * * @author Brad O'Hearne * @author $Author: bentmann $ (last edit) * @version $Revision: 728546 $ */ public class WsrModule extends RarModule { public WsrModule() { } public WsrModule( Artifact a ) { super( a ); } public String getType() { return "wsr"; } }maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java0000644000175000017500000001105611150275561030520 0ustar twernertwernerpackage 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.apache.maven.artifact.Artifact; import org.apache.maven.plugin.ear.util.ArtifactTypeMappingService; import java.util.ArrayList; import java.util.List; /** * Builds an {@link EarModule} based on an Artifact. * * @author Stephane Nicoll * @version $Id: EarModuleFactory.java 746754 2009-02-22 16:21:05Z snicoll $ */ public final class EarModuleFactory { public final static List standardArtifactTypes = new ArrayList(); static { standardArtifactTypes.add( "jar" ); standardArtifactTypes.add( "ejb" ); standardArtifactTypes.add( "ejb3" ); standardArtifactTypes.add( "par" ); standardArtifactTypes.add( "ejb-client" ); standardArtifactTypes.add( "rar" ); standardArtifactTypes.add( "war" ); standardArtifactTypes.add( "sar" ); standardArtifactTypes.add( "wsr" ); standardArtifactTypes.add( "har" ); } /** * Creates a new {@link EarModule} based on the * specified {@link Artifact} and the specified * execution configuration. * * @param artifact the artifact * @param defaultLibBundleDir the default bundle dir for {@link JarModule} * @param includeInApplicationXml should {@link JarModule} be included in application Xml * @return an ear module for this artifact * @throws UnknownArtifactTypeException if the artifact is not handled */ public static EarModule newEarModule( Artifact artifact, String defaultLibBundleDir, Boolean includeInApplicationXml ) throws UnknownArtifactTypeException { // Get the standard artifact type based on default config and user-defined mapping(s) final String artifactType = ArtifactTypeMappingService.getInstance().getStandardType( artifact.getType() ); if ( "jar".equals( artifactType ) ) { return new JarModule( artifact, defaultLibBundleDir, includeInApplicationXml ); } else if ( "ejb".equals( artifactType ) ) { return new EjbModule( artifact ); } else if ( "ejb3".equals( artifactType ) ) { return new Ejb3Module( artifact ); } else if ( "par".equals( artifactType ) ) { return new ParModule( artifact ); } else if ( "ejb-client".equals( artifactType ) ) { return new EjbClientModule( artifact, null ); } else if ( "rar".equals( artifactType ) ) { return new RarModule( artifact ); } else if ( "war".equals( artifactType ) ) { return new WebModule( artifact ); } else if ( "sar".equals( artifactType ) ) { return new SarModule( artifact ); } else if ( "wsr".equals( artifactType ) ) { return new WsrModule( artifact ); } else if ( "har".equals( artifactType ) ) { return new HarModule( artifact ); } else { throw new IllegalStateException( "Could not handle artifact type[" + artifactType + "]" ); } } /** * Returns a list of standard artifact types. * * @return the standard artifact types */ public static List getStandardArtifactTypes() { return standardArtifactTypes; } /** * Specify whether the specified type is standard artifact * type. * * @param type the type to check * @return true if the specified type is a standard artifact type */ public static boolean isStandardArtifactType( final String type ) { return standardArtifactTypes.contains( type ); } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/JbossConfiguration.java0000644000175000017500000002565611150266035031132 0ustar twernertwernerpackage org.apache.maven.plugin.ear; import java.util.List; /* * 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. */ /** * The JBoss specific configuration, used to generate the jboss-app.xml * deployment descriptor file * * @author Stephane Nicoll * @version $Id: JbossConfiguration.java 746726 2009-02-22 15:15:41Z snicoll $ */ class JbossConfiguration { static final String VERSION_3_2 = "3.2"; static final String VERSION_4 = "4"; static final String VERSION_4_2 = "4.2"; static final String VERSION_5 = "5"; static final String VERSION = "version"; static final String SECURITY_DOMAIN = "security-domain"; static final String UNAUHTHENTICTED_PRINCIPAL = "unauthenticated-principal"; static final String JMX_NAME = "jmx-name"; static final String LOADER_REPOSITORY = "loader-repository"; static final String LOADER_REPOSITORY_CLASS_ATTRIBUTE = "loaderRepositoryClass"; static final String LOADER_REPOSITORY_CONFIG = "loader-repository-config"; static final String CONFIG_PARSER_CLASS_ATTRIBUTE = "configParserClass"; static final String MODULE_ORDER = "module-order"; static final String DATASOURCES = "data-sources"; static final String DATASOURCE = "data-source"; static final String LIBRARY_DIRECTORY = "library-directory"; private final String version; private boolean jbossThreeDotTwo; private boolean jbossFour; private boolean jbossFourDotTwo; private boolean jbossFive; private final String securityDomain; private final String unauthenticatedPrincipal; private final String jmxName; private final String loaderRepository; private final String loaderRepositoryConfig; private final String loaderRepositoryClass; private final String configParserClass; private final String moduleOrder; private final List dataSources; private final String libraryDirectory; public JbossConfiguration( String version, String securityDomain, String unauthenticatedPrincipal, String jmxName, String loaderRepository, String moduleOrder, List dataSources, String libraryDirectory, String loaderRepositoryConfig, String loaderRepositoryClass, String configParserClass ) throws EarPluginException { if ( version == null ) { throw new EarPluginException( "jboss version could not be null." ); } else { this.version = version; if ( version.equals( JbossConfiguration.VERSION_3_2 ) ) { this.jbossThreeDotTwo = true; } else if ( version.equals( JbossConfiguration.VERSION_4 ) ) { this.jbossFour = true; } else if ( version.equals( JbossConfiguration.VERSION_4_2 ) ) { this.jbossFourDotTwo = true; } else if ( version.equals( JbossConfiguration.VERSION_5 ) ) { this.jbossFive = true; } else { throw new EarPluginException( "Invalid JBoss configuration, version[" + version + "] is not supported." ); } this.securityDomain = securityDomain; this.unauthenticatedPrincipal = unauthenticatedPrincipal; this.jmxName = jmxName; this.loaderRepository = loaderRepository; this.moduleOrder = moduleOrder; this.dataSources = dataSources; this.libraryDirectory = libraryDirectory; this.loaderRepositoryConfig = loaderRepositoryConfig; this.loaderRepositoryClass = loaderRepositoryClass; this.configParserClass = configParserClass; } } /** * Returns the targeted version of JBoss. * * @return the jboss version */ public String getVersion() { return version; } /** * Returns true if the targeted JBoss version is 3.2. * * @return if the targeted version is 3.2 */ public boolean isJbossThreeDotTwo() { return jbossThreeDotTwo; } /** * Returns true if the targeted JBoss version is 4. * * @return if the targeted version is 4 */ public boolean isJbossFour() { return jbossFour; } /** * Returns true if the targeted JBoss version is 4.2. * * @return if the targeted version is 4.2 */ public boolean isJbossFourDotTwo() { return jbossFourDotTwo; } /** * Returns true if the targeted JBoss version is 5. * * @return if the targeted version is 5 */ public boolean isJbossFive() { return jbossFive; } /** * The security-domain element specifies the JNDI name of the security * manager that implements the EJBSecurityManager and RealmMapping for * the domain. When specified at the jboss level it specifies the security * domain for all j2ee components in the deployment unit. *

* One can override the global security-domain at the container * level using the security-domain element at the container-configuration * level. *

* Only available as from JBoss 4. * * @return the JNDI name of the security manager */ public String getSecurityDomain() { return securityDomain; } /** * The unauthenticated-principal element specifies the name of the principal * that will be returned by the EJBContext.getCallerPrincipal() method if there * is no authenticated user. This Principal has no roles or privaledges to call * any other beans. *

* Only available as from JBoss 4. * * @return the unauthenticated principal */ public String getUnauthenticatedPrincipal() { return unauthenticatedPrincipal; } /** * The jmx-name element allows one to specify the JMX ObjectName to use * for the MBean associated with the ear module. This must be a unique * name and valid JMX ObjectName string. * * @return the object name of the ear mbean */ public String getJmxName() { return jmxName; } /** * The loader-repository specifies the name of the UnifiedLoaderRepository * MBean to use for the ear to provide ear level scoping of classes deployed * in the ear. It is a unique JMX ObjectName string. *

*

Example:

* <loader-repository>jboss.test:loader=cts-cmp2v1-sar.ear</loader-repository> * * @return the object name of the ear mbean */ public String getLoaderRepository() { return loaderRepository; } /** * The module-order specifies the order in which the modules specified * in the application.xml file gets loaded. Allowed values are: *

* strict * The strict value indicates that the deployments of the modules will * be done in the order that would be specified in the application.xml * and jboss-app.xml file. *

* implicit * The implicit value indicates the deployment would follow the order * which would be specified in the DeploymentSorter. *

* Returns null if no module order is set. *

* Only available in JBoss 4.2 and 4.3. Has no effect in JBoss 5 and is * not added when mentioned version is used. * * @return the module order */ public String getModuleOrder() { return moduleOrder; } /** * Returns the list of datasources to include in the jboss-app.xml * file as services. Each element of the list is the relative path to the * datasource file contained in the EAR archive. * * @return the list of datasources paths */ public List getDataSources() { return dataSources; } /** * Returns the library directory to include in the jboss-app.xml file. * It tells JBoss where to find non-Java EE libraries included in the EAR. * * @return the library directory */ public String getLibraryDirectory() { return libraryDirectory; } /** * Returns the class loader repository configuration to include in the jboss-app.xml file. * The content of this element is handed to the class loader, thereby altering it's default behaviour. *

* This element is added as a child to the loader-repository element. If the element is not * present in the configuration, it will be added. *

* Example: <loader-repository-config>java2ParentDelegaton=true</loader-repository-config> * * @return the class loader repository configuration */ public String getLoaderRepositoryConfig() { return loaderRepositoryConfig; } /** * Returns the class loader repository class to include in the jboss-app.xml file. * It tells JBoss which loader repository implementation to use. *

* This element is added as an attribute to the loader-repository element, therefore it is * not added if no such element configuration is present. *

* Example: <loader-repository-class>org.mindbug.jboss.AlternateLoaderRepository</loader-repository-class> * * @return the class loader repository class */ public String getLoaderRepositoryClass() { return loaderRepositoryClass; } /** * Returns the class loader's configuration parser class to include in the jboss-app.xml file. * It tells JBoss how to parse the configuration given in the loader-repository-config element. *

* This element is added as an attribute to the loader-repository-config element, therefore it is * not added if no such element configuration is present. *

* Example: <config-parser-class>org.mindbug.jboss.AlternateLoaderRepositoryConfigParser</config-parser-class> * * @return the class loader's configuration parser class */ public String getConfigParserClass() { return configParserClass; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarExecutionContext.java0000644000175000017500000000575010601246462031255 0ustar twernertwernerpackage 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.apache.maven.plugin.ear.output.FileNameMapping; import org.apache.maven.plugin.ear.output.FileNameMappingFactory; import org.apache.maven.plugin.ear.util.ArtifactRepository; import org.apache.maven.project.MavenProject; /** * Contains various runtime parameters used to customize the generated EAR file. * * @author Stephane Nicoll * @version $Id: EarExecutionContext.java 522047 2007-03-24 16:09:22Z snicoll $ */ public class EarExecutionContext { private static final EarExecutionContext INSTANCE = new EarExecutionContext(); public static EarExecutionContext getInstance() { return INSTANCE; } // Singleton implementation private String defaultLibBundleDir; private JbossConfiguration jbossConfiguration; private FileNameMapping fileNameMapping; private ArtifactRepository artifactRepository; private EarExecutionContext() { } public String getDefaultLibBundleDir() { return defaultLibBundleDir; } public JbossConfiguration getJbossConfiguration() { return jbossConfiguration; } public boolean isJbossConfigured() { return jbossConfiguration != null; } public FileNameMapping getFileNameMapping() { return fileNameMapping; } public ArtifactRepository getArtifactRepository() { return artifactRepository; } protected void initialize( MavenProject project, String mainArtifactId, String defaultLibBundleDir, JbossConfiguration jbossConfiguration, String fileNameMappingName ) { this.artifactRepository = new ArtifactRepository( project.getArtifacts(), mainArtifactId); this.defaultLibBundleDir = defaultLibBundleDir; this.jbossConfiguration = jbossConfiguration; if ( fileNameMappingName == null || fileNameMappingName.trim().length() == 0 ) { this.fileNameMapping = FileNameMappingFactory.INSTANCE.getDefaultFileNameMapping(); } else { this.fileNameMapping = FileNameMappingFactory.INSTANCE.getFileNameMapping( fileNameMappingName ); } } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriterContext.java0000644000175000017500000000555611136720503033004 0ustar twernertwernerpackage org.apache.maven.plugin.ear; import java.io.File; import java.util.List; /* * 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. */ /** * A context for the {@link ApplicationXmlWriter}. * * @author Stephane Nicoll * @version $Id: ApplicationXmlWriter.java 728546 2008-12-21 22:56:51Z bentmann $ */ class ApplicationXmlWriterContext { private final File destinationFile; private final List earModules; private final List securityRoles; private final String displayName; private final String description; private final String libraryDirectory; public ApplicationXmlWriterContext(File destinationFile, List earModules, List securityRoles, String displayName, String description, String libraryDirectory) { this.destinationFile = destinationFile; this.earModules = earModules; this.securityRoles = securityRoles; this.displayName = displayName; this.description = description; this.libraryDirectory = libraryDirectory; } /** * Returns the name of the file to use to write application.xml to. * * @return the output file */ public File getDestinationFile() { return destinationFile; } /** * Returns the list of {@link EarModule} instances. * * @return the ear modules */ public List getEarModules() { return earModules; } /** * Returns the list of {Žlink SecurityRole} instances. * * @return the security roles */ public List getSecurityRoles() { return securityRoles; } /** * Returns the display name. * * @return the display name */ public String getDisplayName() { return displayName; } /** * Returns the description. * * @return the description */ public String getDescription() { return description; } /** * Returns the library directory (as per JavaEE 5). * * @return the library directory */ public String getLibraryDirectory() { return libraryDirectory; } } maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/UnknownArtifactTypeException.java0000644000175000017500000000241211123544663033147 0ustar twernertwernerpackage 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. */ /** * Thrown if an unknown artifact type is encountered. * * @author Stephane Nicoll * @version $Id: UnknownArtifactTypeException.java 728546 2008-12-21 22:56:51Z bentmann $ */ public class UnknownArtifactTypeException extends EarPluginException { public UnknownArtifactTypeException() { } public UnknownArtifactTypeException( String message ) { super( message ); } } maven-ear-plugin-2.3.2/pom.xml0000644000175000017500000001432611152603624016146 0ustar twernertwerner 4.0.0 maven-plugins org.apache.maven.plugins 13 maven-ear-plugin 2.3.2 maven-plugin Maven EAR Plugin Generates a J2EE Enterprise Archive (EAR) file. 2.0.6 scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-ear-plugin-2.3.2 scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ear-plugin-2.3.2 http://svn.apache.org/viewvc/maven/plugins/tags/maven-ear-plugin-2.3.2 JIRA http://jira.codehaus.org/browse/MEAR org.apache.maven maven-project 2.0.6 org.apache.maven maven-plugin-api 2.0.6 org.apache.maven maven-artifact 2.0.6 org.apache.maven maven-archiver 2.2 org.codehaus.plexus plexus-utils 1.5.7 org.apache.maven.shared maven-filtering 1.0-beta-2 org.apache.maven.shared maven-verifier 1.0 test xmlunit xmlunit 1.2 test maven-surefire-plugin **/*Test.java **/Abstract*.java run-its maven-antrun-plugin pre-integration-test run maven-invoker-plugin 1.3 true src/it ${project.build.directory}/it */pom.xml setup verify ${project.build.testOutputDirectory}/m2repo src/it/settings.xml clean package integration-test install run maven-surefire-plugin integration-test test **/*IT.java