You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/20 09:34:03 UTC

[maven-ear-plugin] annotated tag maven-ear-plugin-2.1 created (now 9f6d939)

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a change to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git.


      at 9f6d939  (tag)
 tagging b7fce46cfe8e3af086d633e594122b09dcde7f21 (commit)
      by John Dennis Casey
      on Mon Dec 19 20:32:20 2005 +0000

- Log -----------------------------------------------------------------
maven-ear-plugin-2.1
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new f9f615c  PR: MNG-148 Submitted by: Stephane Nicoll Reviewed by:  Brett Porter, Emmanuel Venisse Implementation of an EAR plugin
     new d33b1d6  PR: MNG-378 Only deploy the release information at the point of release
     new 794551f  Move maven-ear-plugin to maven-plugins
     new cc3bb8e  Applying patch(es) for: MNG-576
     new a32f02e  Fix svn properties
     new 893a014  Bumping plexus-utils version to 1.0.1
     new 5bdb37e  PR: MNG-596 add XSD definition to m2 poms and archetypes
     new 42e0344  move main J2EE packaging definitions back to being built in
     new 6602a33  PR: MNG-651 include ejb-clients in an EAR
     new f21a6a3  o Put all m2 core dependencies (plexus-container-default and plexus-utils)   under dependencyManagement of m2 and maven-plugins, and removed   versions in all poms having either as a parent.   Used version 1.0.2-SNAPSHOT for plexus-utils as that was used in maven-core   and is not overridable.
     new f9df973  o Bumped version of plexus-container-default to 1.0-alpha-6-SNAPSHOT
     new d1e74bf  Forgot to remove the module package.
     new 837daa1  o Resolved MNG-692, although I think a more general solution is required;
     new 5ddbffa  Add missing )
     new b02a807  MNG-736: Move ear source directory to comply with other plugin's structure. Applied on Stephane's behalf.
     new d8c4354  Fixing MNG-623: "Improve the exclusion / inclusion of a dependency inside the                 ear" Committing on behalf of Stephane Nicoll. Provides two new flags to customize ear modules:
     new 55fa893  Removed excludedDependencySet as it has been implemented another way
     new 971ad18  Now allowing custom manifest file to be set in the generated EAR file.
     new 9c87580  PR: MNG-822 Submitted by: Edwin Punzalan Reviewed by:  Brett Porter EAR improvements
     new 4b589a6  o Setting svn:ignore.
     new 4d89c27  MNG-826: - Jar dependencies are not included in the generated application.xml ; Hence 'library' is the default behavior and has been removed - Added includeInApplicationXml property on JavaModule to allow it to be included in the generated application.xml
     new bba8d20  update dependency and parent versions
     new 8307ef7  [maven-release-plugin] prepare release maven-ear-plugin-2.0-beta-1
     new 2862fb7  [maven-release-plugin] prepare for next development iteration
     new 0a1da56  ignore release.properties and more
     new c794cae  Updated web site documentation according to Johnny R. Ruiz III's work.
     new 8a40b71  changing email address.
     new 14520a5  missing : in id.
     new 379c7de  info log now specifies that maven will generate a MANIFEST if the custom manifest is not found.
     new 1fc6432  Resolving: MNG-885
     new efcb59d  fix ordering of display-name and description in accordance with the xsd
     new 353c13f  PR: MNG-1025 use standard resources for the ear plugin
     new e31344d  [MNG-1071] lookup archiver instead of calling contructor so output will be use with the correct logger. I forgot to modify these files
     new 9b8e940  Fix tabs
     new 9b4efc6  use released versions
     new ef69c01  set parent
     new 7f29b91  [maven-release-plugin] prepare release maven-ear-plugin-2.0-beta-2
     new b1d7242  [maven-release-plugin] prepare for next development iteration
     new d4cb104  upgrade plexus utils to 1.0.4-SNAPSHOT. The group ID has changed, so add a bunch of exclusions to ensure the old is not picked up fix bugs in mboot that wasn't honoring excludes.
     new a25064b  PR: MNG-616 improve version logging, use artifact.toString for textual logging
     new de85753  PR: MNG-829 Submitted by: Johnny R. Ruiz III Reviewed by:  Brett Porter use File for basedir aligned parameters in various plugins
     new 0f8aa69  clean up ear plugin exception handling
     new c8c0f40  update versions in plugins
     new df5ac4e  [maven-release-plugin] prepare release maven-ear-plugin-2.0
     new 34c3de5  [maven-release-plugin] prepare for next development iteration
     new 40cee6a  PR: MNG-1264 Submitted by: Jerome Lacoste Reviewed by:  Stephane Nicoll Support of PAR and EJB3 artifact's type in EAR plugin
     new 5ae825b  ignore
     new be0c283  PR: MNG-1296 Submitted by: Edwin Punzalan Reviewed by:  Brett Porter use scope filter and optional flag instead of hard coding
     new 4759928  PR: MNG-1402 Submitted by: Tomislav Stojcevich Reviewed by: Stephane Nicoll Fixed compliance of generated application.xml (display-name and description different in 1.3 and 1.4)
     new 3e014d4  - MNG-1461: custom application.xml can now be specified properly. Overrides any other file found in the source directories - MNG-1444: added directory scanner to exclude common directories (subversion, CVS files, etc). Added earSourceIncludes and earSourceExcludes properties to specify the list of tokens to include and exclude respectively.
     new 4206b50  MNG-1488: added global scope defaultJavaBundleDir property. If set, all Java modules without a custom bundleDir are placed in the default bundle directory. See howto for an example.
     new 429b53c  move plugins
     new 96c3405  Set correct subversion properties
     new de0ab2f  [MNG-1598] Use maven-archiver snapshot
     new 2f57dab  MNG-1723: fixed configuration of ejb3 and par modules.
     new 62a7956  Updating poms to change dependencies on 2.0.1-SNAPSHOT info to 2.0.1 (parent-poms, and a couple references to maven-archiver).
     new 5149723  Added apache license.
     new 347ef26  MNG-1852: Added support of sar files.
     new b7fce46  [maven-scm] copy for tag maven-ear-plugin-2.1

The 59 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <co...@maven.apache.org>'].

[maven-ear-plugin] 13/16: Updating poms to change dependencies on 2.0.1-SNAPSHOT info to 2.0.1 (parent-poms, and a couple references to maven-archiver).

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 62a7956c1022d5eace4053e8b8a53fdf05f99b85
Author: John Dennis Casey <jd...@apache.org>
AuthorDate: Thu Dec 15 00:27:27 2005 +0000

    Updating poms to change dependencies on 2.0.1-SNAPSHOT info to 2.0.1 (parent-poms, and a couple references to maven-archiver).
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ear-plugin@356959 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 955a5cd..f300508 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,11 +17,11 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-archiver</artifactId>
-      <version>2.0.1-SNAPSHOT</version>
+      <version>2.0.1</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 15/16: MNG-1852: Added support of sar files.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 347ef26f422d0feb8e2265aedac857f628dc6d50
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Fri Dec 16 16:02:41 2005 +0000

    MNG-1852: Added support of sar files.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ear-plugin@357175 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/maven/plugin/ear/EarModuleFactory.java  |  4 ++
 .../org/apache/maven/plugin/ear/SarModule.java     | 56 ++++++++++++++++++++++
 src/site/apt/introduction.apt                      | 18 +++++++
 3 files changed, 78 insertions(+)

diff --git a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
index afafa93..8093781 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
@@ -66,6 +66,10 @@ public final class EarModuleFactory
         {
             return new WebModule( artifact );
         }
+        else if ( "sar".equals( artifact.getType() ) )
+        {
+            return new SarModule( artifact );
+        }
         else
         {
             throw new IllegalStateException( "Could not handle artifact type[" + artifact.getType() + "]" );
diff --git a/src/main/java/org/apache/maven/plugin/ear/SarModule.java b/src/main/java/org/apache/maven/plugin/ear/SarModule.java
new file mode 100644
index 0000000..c1eda85
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugin/ear/SarModule.java
@@ -0,0 +1,56 @@
+package org.apache.maven.plugin.ear;
+
+/*
+ * Copyright 2001-2005 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.
+ */
+
+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 <sn...@apache.org>
+ * @author $Author: $ (last edit)
+ * @version $Revision:  $
+ */
+public class SarModule
+    extends AbstractEarModule
+{
+    protected static final String SAR_MODULE = "connector";
+
+    public SarModule()
+    {
+    }
+
+    public SarModule( Artifact a )
+    {
+        super( a );
+    }
+
+    public void appendModule( XMLWriter writer, String version )
+    {
+        writer.startElement( MODULE_ELEMENT );
+        writer.startElement( SAR_MODULE );
+        writer.writeText( getUri() );
+        writer.endElement();
+        writer.endElement();
+    }
+
+    protected String getType()
+    {
+        return "sar";
+    }
+}
diff --git a/src/site/apt/introduction.apt b/src/site/apt/introduction.apt
index 79c1c7d..0bd1088 100644
--- a/src/site/apt/introduction.apt
+++ b/src/site/apt/introduction.apt
@@ -13,5 +13,23 @@ Introduction
 
   The full description of goals is available {{{index.html}here}}.
 
+Supported artifacts
 
+  The EAR plugin supports the following artifacts:
+
+  * ejb
+
+  * war
+
+  * jar
+
+  * ejb-client
+
+  * rar
+
+  * ejb3
+
+  * par
+
+  * sar
 

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 04/16: ignore

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 5ae825bff42f8660bb25e4d249ac8a7b11f6da72
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Sun Oct 23 22:10:56 2005 +0000

    ignore
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@327866 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 16/16: [maven-scm] copy for tag maven-ear-plugin-2.1

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit b7fce46cfe8e3af086d633e594122b09dcde7f21
Author: John Dennis Casey <jd...@apache.org>
AuthorDate: Mon Dec 19 20:32:20 2005 +0000

    [maven-scm] copy for tag maven-ear-plugin-2.1
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ear-plugin-2.1@357784 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index f300508..e192dca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,14 +1,14 @@
-<project>
+<?xml version="1.0" encoding="UTF-8"?><project>
   <parent>
     <artifactId>maven-plugin-parent</artifactId>
     <groupId>org.apache.maven.plugins</groupId>
-    <version>2.0</version>
+    <version>2.0.1</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>maven-ear-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven Ear plugin</name>
-  <version>2.1-SNAPSHOT</version>
+  <version>2.1</version>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -24,4 +24,4 @@
       <artifactId>plexus-utils</artifactId>
     </dependency>
   </dependencies>
-</project>
+</project>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 12/16: MNG-1723: fixed configuration of ejb3 and par modules.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 2f57dab89bed281d537b32436a55d53861449f43
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Thu Dec 1 19:30:01 2005 +0000

    MNG-1723: fixed configuration of ejb3 and par modules.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ear-plugin@350306 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/maven/plugin/ear/EarModuleFactory.java  |  4 +--
 .../org/apache/maven/plugin/ear/Ejb3Module.java    | 32 +++++++++++++++++++++
 .../org/apache/maven/plugin/ear/ParModule.java     | 33 ++++++++++++++++++++++
 3 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
index a8825ea..afafa93 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
@@ -48,11 +48,11 @@ public final class EarModuleFactory
         }
         else if ( "ejb3".equals( artifact.getType() ) )
         {
-            return new EjbModule( artifact );
+            return new Ejb3Module( artifact );
         }
         else if ( "par".equals( artifact.getType() ) )
         {
-            return new EjbModule( artifact );
+            return new ParModule( artifact );
         }
         else if ( "ejb-client".equals( artifact.getType() ) )
         {
diff --git a/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java b/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java
new file mode 100644
index 0000000..31cfac5
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ */
+package org.apache.maven.plugin.ear;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * The {@link EarModule} implementation for an Ejb3 module.
+ *
+ * @author Stephane Nicoll <sn...@apache.org>
+ * @author $Author: $ (last edit)
+ * @version $Revision:  $
+ */
+public class Ejb3Module
+    extends EjbModule
+{
+    public Ejb3Module()
+    {
+        super();
+    }
+
+    public Ejb3Module( Artifact a )
+    {
+        super( a );
+    }
+
+    protected String getType()
+    {
+        return "ejb3";
+    }
+}
diff --git a/src/main/java/org/apache/maven/plugin/ear/ParModule.java b/src/main/java/org/apache/maven/plugin/ear/ParModule.java
new file mode 100644
index 0000000..c50d7e1
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugin/ear/ParModule.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ */
+package org.apache.maven.plugin.ear;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * The {@link EarModule} implementation for a Par module.
+ *
+ * @author Stephane Nicoll <sn...@apache.org>
+ * @author $Author: $ (last edit)
+ * @version $Revision:  $
+ */
+public class ParModule
+    extends EjbModule
+{
+
+    public ParModule()
+    {
+        super();
+    }
+
+    public ParModule( Artifact a )
+    {
+        super( a );
+    }
+
+    protected String getType()
+    {
+        return "par";
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 11/16: [MNG-1598] Use maven-archiver snapshot

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit de0ab2fdd5b8a8f230f05bd80eb41f069648ab8a
Author: Emmanuel Venisse <ev...@apache.org>
AuthorDate: Fri Nov 18 00:19:58 2005 +0000

    [MNG-1598] Use maven-archiver snapshot
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ear-plugin@345382 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1a8e23c..955a5cd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-archiver</artifactId>
-      <version>2.0</version>
+      <version>2.0.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 01/16: [maven-release-plugin] prepare release maven-ear-plugin-2.0

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit df5ac4e75f09bb01dd416e2c60fbf57910c42d5d
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Sat Oct 15 18:03:35 2005 +0000

    [maven-release-plugin] prepare release maven-ear-plugin-2.0
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@321395 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 93f1d72..a09023d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
   <artifactId>maven-ear-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven Ear plugin</name>
-  <version>2.0-beta-3-SNAPSHOT</version>
+  <version>2.0</version>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -24,4 +24,4 @@
       <artifactId>plexus-utils</artifactId>
     </dependency>
   </dependencies>
-</project>
+</project>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 08/16: MNG-1488: added global scope defaultJavaBundleDir property. If set, all Java modules without a custom bundleDir are placed in the default bundle directory. See howto for an example.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 4206b5028e4ac05b036239c3e33e5d064d13aebc
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Sun Nov 13 12:42:44 2005 +0000

    MNG-1488: added global scope defaultJavaBundleDir property. If set, all Java modules without a custom bundleDir are placed in the default bundle directory. See howto for an example.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@332974 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/maven/plugin/ear/AbstractEarModule.java | 18 ++++++-------
 .../apache/maven/plugin/ear/AbstractEarMojo.java   | 11 ++++++--
 .../org/apache/maven/plugin/ear/EarModule.java     | 12 +++++----
 .../apache/maven/plugin/ear/EarModuleFactory.java  | 10 +++++---
 .../apache/maven/plugin/ear/EjbClientModule.java   |  2 +-
 .../org/apache/maven/plugin/ear/JavaModule.java    | 27 ++++++++++++++++++-
 .../org/apache/maven/plugin/ear/WebModule.java     |  4 +--
 src/site/apt/howto.apt                             | 30 ++++++++++++++++++++++
 .../apache/maven/plugin/ear/EarModuleTest.java}    | 27 ++++++++-----------
 9 files changed, 99 insertions(+), 42 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java b/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
index f07b3e1..1aefba2 100644
--- a/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
+++ b/src/main/java/org/apache/maven/plugin/ear/AbstractEarModule.java
@@ -44,11 +44,11 @@ public abstract class AbstractEarModule
 
     private String artifactId;
 
-    private String bundleDir;
+    protected String bundleDir;
 
-    private String bundleFileName;
+    protected String bundleFileName;
 
-    private Boolean excluded = Boolean.FALSE;
+    protected Boolean excluded = Boolean.FALSE;
 
     /**
      * Empty constructor to be used when the module
@@ -71,7 +71,7 @@ public abstract class AbstractEarModule
         this.bundleDir = null;
     }
 
-    public void resolveArtifact( Set artifacts )
+    public void resolveArtifact( Set artifacts, String defaultJavaBundleDir )
         throws MojoFailureException
     {
         if ( artifact == null )
@@ -210,7 +210,7 @@ public abstract class AbstractEarModule
      * @param bundleDir the bundle directory to clean
      * @return the cleaned bundle directory
      */
-    private static String cleanBundleDir( String bundleDir )
+    static String cleanBundleDir( String bundleDir )
     {
         if ( bundleDir == null )
         {
@@ -221,19 +221,17 @@ public abstract class AbstractEarModule
         bundleDir = bundleDir.replace( '\\', '/' );
 
         // Remove '/' prefix if any so that directory is a relative path
-        if ( bundleDir.startsWith( " / " ) )
+        if ( bundleDir.startsWith( "/" ) )
         {
             bundleDir = bundleDir.substring( 1, bundleDir.length() );
         }
 
-        // Adding '/' suffix to specify a directory structure
-        if ( !bundleDir.endsWith( "/" ) )
+        if ( bundleDir.length() > 0 && !bundleDir.endsWith( "/" ) )
         {
+            // Adding '/' suffix to specify a directory structure if it is not empty
             bundleDir = bundleDir + "/";
         }
 
-        System.out.println( "Bundle dir[" + bundleDir + "]" );
-
         return bundleDir;
     }
 }
diff --git a/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java b/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
index 4b6f8f1..4df21ff 100644
--- a/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
+++ b/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
@@ -60,6 +60,13 @@ public abstract class AbstractEarMojo
     private EarModule[] modules;
 
     /**
+     * The default bundle dir for Java modules.
+     *
+     * @parameter
+     */
+    private String defaultJavaBundleDir;
+
+    /**
      * Directory that resources are copied to during the build.
      *
      * @parameter expression="${project.build.directory}/${project.build.finalName}"
@@ -88,7 +95,7 @@ public abstract class AbstractEarMojo
                 {
                     module = (EarModule) modules[i];
                     getLog().debug( "Resolving ear module[" + module + "]" );
-                    module.resolveArtifact( project.getArtifacts() );
+                    module.resolveArtifact( project.getArtifacts(), defaultJavaBundleDir );
                     allModules.add( module );
                 }
             }
@@ -109,7 +116,7 @@ public abstract class AbstractEarMojo
             ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
             if ( !isArtifactRegistered( artifact, allModules ) && !artifact.isOptional() && filter.include( artifact ) )
             {
-                EarModule module = EarModuleFactory.newEarModule( artifact );
+                EarModule module = EarModuleFactory.newEarModule( artifact, defaultJavaBundleDir );
                 allModules.add( module );
             }
         }
diff --git a/src/main/java/org/apache/maven/plugin/ear/EarModule.java b/src/main/java/org/apache/maven/plugin/ear/EarModule.java
index 0eb642f..98d7636 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EarModule.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EarModule.java
@@ -38,7 +38,7 @@ public interface EarModule
      * module has been resolved.
      *
      * @return the artifact
-     * @see #resolveArtifact(java.util.Set)
+     * @see #resolveArtifact(java.util.Set, String)
      */
     public Artifact getArtifact();
 
@@ -59,18 +59,20 @@ public interface EarModule
     /**
      * Appends the <tt>XML</tt> representation of this module.
      *
-     * @param writer the writer to use
+     * @param writer  the writer to use
      * @param version the version of the <tt>application.xml</tt> file
      */
     public void appendModule( XMLWriter writer, String version );
 
     /**
-     * Resolves the {@link Artifact} represented by the module.
+     * Resolves the {@link Artifact} represented by the module with
+     * the specified execution configuration.
      *
-     * @param artifacts the project's artifacts
+     * @param artifacts            the project's artifacts
+     * @param defaultJavaBundleDir the default bundle dir for {@link JavaModule}
      * @throws EarPluginException if the artifact could not be resolved
      */
-    public void resolveArtifact( Set artifacts )
+    public void resolveArtifact( Set artifacts, String defaultJavaBundleDir )
         throws EarPluginException, MojoFailureException;
 
 }
diff --git a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
index 7553ec9..a8825ea 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
@@ -29,16 +29,18 @@ public final class EarModuleFactory
 
     /**
      * Creates a new {@link EarModule} based on the
-     * specified {@link Artifact}.
+     * specified {@link Artifact} and the specified
+     * execution configuration.
      *
-     * @param artifact the artifact
+     * @param artifact             the artifact
+     * @param defaultJavaBundleDir the default bundle dir for {@link JavaModule}
      * @return an ear module for this artifact
      */
-    public static final EarModule newEarModule( Artifact artifact )
+    public static final EarModule newEarModule( Artifact artifact, String defaultJavaBundleDir )
     {
         if ( "jar".equals( artifact.getType() ) )
         {
-            return new JavaModule( artifact );
+            return new JavaModule( artifact, defaultJavaBundleDir );
         }
         else if ( "ejb".equals( artifact.getType() ) )
         {
diff --git a/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java b/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
index 5849df0..e72cf9d 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
@@ -34,7 +34,7 @@ public class EjbClientModule
 
     public EjbClientModule( Artifact a )
     {
-        super( a );
+        super( a, null );
     }
 
     protected String getType()
diff --git a/src/main/java/org/apache/maven/plugin/ear/JavaModule.java b/src/main/java/org/apache/maven/plugin/ear/JavaModule.java
index 94a90ef..cf24b79 100644
--- a/src/main/java/org/apache/maven/plugin/ear/JavaModule.java
+++ b/src/main/java/org/apache/maven/plugin/ear/JavaModule.java
@@ -17,8 +17,11 @@ package org.apache.maven.plugin.ear;
  */
 
 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 J2EE client module.
  *
@@ -34,11 +37,14 @@ public class JavaModule
 
     public JavaModule()
     {
+
     }
 
-    public JavaModule( Artifact a )
+    public JavaModule( Artifact a, String defaultJavaBundleDir )
     {
         super( a );
+        setJavaBundleDir( defaultJavaBundleDir );
+
     }
 
     public void appendModule( XMLWriter writer, String version )
@@ -55,8 +61,27 @@ public class JavaModule
         }
     }
 
+    public void resolveArtifact( Set artifacts, String defaultJavaBundleDir )
+        throws MojoFailureException
+    {
+        // Let's resolve the artifact
+        super.resolveArtifact( artifacts, defaultJavaBundleDir );
+
+        // If the defaultJavaBundleDir is set and no bundle dir is
+        // set, set the default as bundle dir
+        setJavaBundleDir( defaultJavaBundleDir );
+    }
+
     protected String getType()
     {
         return "jar";
     }
+
+    private void setJavaBundleDir( String defaultJavaBundleDir )
+    {
+        if ( defaultJavaBundleDir != null && bundleDir == null )
+        {
+            this.bundleDir = defaultJavaBundleDir;
+        }
+    }
 }
diff --git a/src/main/java/org/apache/maven/plugin/ear/WebModule.java b/src/main/java/org/apache/maven/plugin/ear/WebModule.java
index 5e06235..098f4de 100644
--- a/src/main/java/org/apache/maven/plugin/ear/WebModule.java
+++ b/src/main/java/org/apache/maven/plugin/ear/WebModule.java
@@ -63,11 +63,11 @@ public class WebModule
         writer.endElement(); // module
     }
 
-    public void resolveArtifact( Set artifacts )
+    public void resolveArtifact( Set artifacts, String defaultJavaBundleDir )
         throws MojoFailureException
     {
         // Let's resolve the artifact
-        super.resolveArtifact( artifacts );
+        super.resolveArtifact( artifacts, defaultJavaBundleDir );
 
         // Context root has not been customized - using default
         if ( contextRoot == null )
diff --git a/src/site/apt/howto.apt b/src/site/apt/howto.apt
index 4e10bdc..883da74 100644
--- a/src/site/apt/howto.apt
+++ b/src/site/apt/howto.apt
@@ -30,6 +30,8 @@ Introduction
   jar dependency could be included in the generated application.xml by specifying the
   includeInApplicationXml flag.
 
+  It is also possible to specify a default bundle directory for all third party libraries
+
 Customizing the context root
 
   The sample below shows how to customize the context root of an artifact to be placed
@@ -81,6 +83,34 @@ Customizing a module location
   </build>
 +---------
 
+  Note that it is possible to specify a default bundle directory for all Java modules. If a Java module
+  has not the bundleDir property above, the default one is used. Here is an example of such configuration:
+
++--------
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <defaultBundleDir>APP-INF/lib
+        <configuration>
+           [...]
+           <modules>
+             <javaModule>
+               <groupId>artifactGroupId</groupId>
+               <artifactId>artifactId</artifactId>
+               <bundleDir>/</bundleDir>
+             </javaModule>
+          </modules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
++---------
+
+  In this case, all Java modules will be placed in the APP-INF/lib directory except the specified artifact
+  which will be placed at the root of the EAR structure.
+
 Customizing a module file name
 
   The sample below shows how to rename a module being placed in the EAR file:
diff --git a/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java b/src/test/java/org/apache/maven/plugin/ear/EarModuleTest.java
similarity index 52%
copy from src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
copy to src/test/java/org/apache/maven/plugin/ear/EarModuleTest.java
index 5849df0..003cc75 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EjbClientModule.java
+++ b/src/test/java/org/apache/maven/plugin/ear/EarModuleTest.java
@@ -16,29 +16,22 @@ package org.apache.maven.plugin.ear;
  * limitations under the License.
  */
 
-import org.apache.maven.artifact.Artifact;
+import junit.framework.TestCase;
 
 /**
- * The {@link EarModule} implementation for an Ejb-client module.
+ * Ear module test case.
  *
  * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
- * @version $Id$
+ * @version $Id: AbstractEarModule.java 314956 2005-10-12 18:27:15 +0200 (Wed, 12 Oct 2005) brett $
  */
-public class EjbClientModule
-    extends JavaModule
+public class EarModuleTest extends TestCase
 {
 
-    public EjbClientModule()
-    {
-    }
-
-    public EjbClientModule( Artifact a )
-    {
-        super( a );
-    }
-
-    protected String getType()
-    {
-        return "ejb-client";
+    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( "/"));
     }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 14/16: Added apache license.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 514972394f67b6d99e126564d7d34cb46fb0813e
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Fri Dec 16 15:37:40 2005 +0000

    Added apache license.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ear-plugin@357173 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/maven/plugin/ear/Ejb3Module.java    | 17 +++++++++++++++--
 .../java/org/apache/maven/plugin/ear/ParModule.java     | 17 +++++++++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java b/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java
index 31cfac5..5efcad7 100644
--- a/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java
+++ b/src/main/java/org/apache/maven/plugin/ear/Ejb3Module.java
@@ -1,7 +1,20 @@
+package org.apache.maven.plugin.ear;
+
 /*
- * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ * Copyright 2001-2005 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.
  */
-package org.apache.maven.plugin.ear;
 
 import org.apache.maven.artifact.Artifact;
 
diff --git a/src/main/java/org/apache/maven/plugin/ear/ParModule.java b/src/main/java/org/apache/maven/plugin/ear/ParModule.java
index c50d7e1..4004f86 100644
--- a/src/main/java/org/apache/maven/plugin/ear/ParModule.java
+++ b/src/main/java/org/apache/maven/plugin/ear/ParModule.java
@@ -1,7 +1,20 @@
+package org.apache.maven.plugin.ear;
+
 /*
- * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ * Copyright 2001-2005 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.
  */
-package org.apache.maven.plugin.ear;
 
 import org.apache.maven.artifact.Artifact;
 

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 09/16: move plugins

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 429b53cd33b8e7041ad25a65d4cdd2e312228b57
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Wed Nov 16 13:24:46 2005 +0000

    move plugins
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ear-plugin@345007 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 10/16: Set correct subversion properties

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 96c3405cfa010ac967a2e7d7a6caf94c1e55e706
Author: Carlos Sanchez Gonzalez <ca...@apache.org>
AuthorDate: Thu Nov 17 07:42:21 2005 +0000

    Set correct subversion properties
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ear-plugin@345205 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 03/16: PR: MNG-1264 Submitted by: Jerome Lacoste Reviewed by: Stephane Nicoll Support of PAR and EJB3 artifact's type in EAR plugin

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 40cee6aec98bf496d560c22ae96220caf6e25e66
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Sat Oct 22 11:14:37 2005 +0000

    PR: MNG-1264
    Submitted by: Jerome Lacoste
    Reviewed by:  Stephane Nicoll
    Support of PAR and EJB3 artifact's type in EAR plugin
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@327654 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
index c9c44ec..7553ec9 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
@@ -44,6 +44,14 @@ public final class EarModuleFactory
         {
             return new EjbModule( artifact );
         }
+        else if ( "ejb3".equals( artifact.getType() ) )
+        {
+            return new EjbModule( artifact );
+        }
+        else if ( "par".equals( artifact.getType() ) )
+        {
+            return new EjbModule( artifact );
+        }
         else if ( "ejb-client".equals( artifact.getType() ) )
         {
             return new EjbClientModule( artifact );

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 02/16: [maven-release-plugin] prepare for next development iteration

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 34c3de5537483cf9721d56a5d948e73ca04c9dcd
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Sat Oct 15 18:05:29 2005 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@321397 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index a09023d..1a8e23c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
   <artifactId>maven-ear-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven Ear plugin</name>
-  <version>2.0</version>
+  <version>2.1-SNAPSHOT</version>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 07/16: - MNG-1461: custom application.xml can now be specified properly. Overrides any other file found in the source directories - MNG-1444: added directory scanner to exclude common directories (subversion, CVS files, etc). Added earSourceIncludes and earSourceExcludes properties to specify the list of tokens to include and exclude respectively.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 3e014d46f7b75b97008249d3bb10df00b69aa24c
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Wed Nov 9 19:40:29 2005 +0000

    - MNG-1461: custom application.xml can now be specified properly. Overrides any other file found in the source directories
    - MNG-1444: added directory scanner to exclude common directories (subversion, CVS files, etc). Added earSourceIncludes and earSourceExcludes properties to specify the list of tokens to include and exclude respectively.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@332123 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/maven/plugin/ear/AbstractEarMojo.java   |   4 +-
 .../java/org/apache/maven/plugin/ear/EarMojo.java  | 117 +++++++++++++++++++--
 2 files changed, 114 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java b/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
index 167851c..4b6f8f1 100644
--- a/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
+++ b/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
@@ -17,6 +17,7 @@ package org.apache.maven.plugin.ear;
  */
 
 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;
@@ -27,7 +28,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
-import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
 
 /**
  * A base class for EAR-processing related tasks.
@@ -41,6 +41,8 @@ public abstract class AbstractEarMojo
 
     public static final String APPLICATION_XML_URI = "META-INF/application.xml";
 
+    public static final String META_INF = "META-INF";
+
     /**
      * The maven project.
      *
diff --git a/src/main/java/org/apache/maven/plugin/ear/EarMojo.java b/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
index e174288..d0db439 100644
--- a/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
+++ b/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
@@ -21,11 +21,14 @@ import org.apache.maven.archiver.MavenArchiver;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.util.DirectoryScanner;
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
 
 /**
  * Builds J2EE Enteprise Archive (EAR) files.
@@ -49,6 +52,23 @@ public class EarMojo
     private File earSourceDirectory;
 
     /**
+     * The comma separated list of tokens to include in the EAR.
+     * Default is '**'.
+     *
+     * @parameter alias="includes"
+     */
+    private String earSourceIncludes = "**";
+
+    /**
+     * The comma separated list of tokens to exclude from the EAR.
+     *
+     * @parameter alias="excludes"
+     */
+    private String earSourceExcludes;
+
+    private static final String[] EMPTY_STRING_ARRAY = {};
+
+    /**
      * The location of the manifest file to be used within the ear file.
      *
      * @parameter expression="${basedir}/src/main/application/META-INF/MANIFEST.MF"
@@ -56,11 +76,12 @@ public class EarMojo
     private File manifestFile;
 
     /**
-     * The location of the application.xml file to be used within the ear file.
+     * The location of a custom application.xml file to be used
+     * within the ear file.
      *
-     * @parameter expression="${basedir}/src/main/application/META-INF/application.xml"
+     * @parameter
      */
-    private File applicationXmlFile;
+    private String applicationXml;
 
     /**
      * The directory for the generated EAR.
@@ -112,7 +133,7 @@ public class EarMojo
         getLog().debug( " ======= EarMojo settings =======" );
         getLog().debug( "earSourceDirectory[" + earSourceDirectory + "]" );
         getLog().debug( "manifestLocation[" + manifestFile + "]" );
-        getLog().debug( "applicationXmlLocation[" + applicationXmlFile + "]" );
+        getLog().debug( "applicationXml[" + getApplicationXml() + "]" );
         getLog().debug( "workDirectory[" + getWorkDirectory() + "]" );
         getLog().debug( "outputDirectory[" + outputDirectory + "]" );
         getLog().debug( "finalName[" + finalName + "]" );
@@ -149,8 +170,22 @@ public class EarMojo
             if ( earSourceDir.exists() )
             {
                 getLog().info( "Copy ear sources to " + getWorkDirectory().getAbsolutePath() );
-                FileUtils.copyDirectoryStructure( earSourceDir, getWorkDirectory() );
+                String[] fileNames = getEarFiles( earSourceDir );
+                for ( int i = 0; i < fileNames.length; i++ )
+                {
+                    FileUtils.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 );
+                FileUtils.copyFile( new File( applicationXml ), new File( metaInfDir, "/application.xml" ) );
             }
+
         }
         catch ( IOException e )
         {
@@ -163,7 +198,12 @@ public class EarMojo
             if ( resourcesDir.exists() )
             {
                 getLog().info( "Copy ear resources to " + getWorkDirectory().getAbsolutePath() );
-                FileUtils.copyDirectoryStructure( resourcesDir, getWorkDirectory() );
+                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 )
@@ -200,6 +240,50 @@ public class EarMojo
         }
     }
 
+    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.add( 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 new String[]{earSourceIncludes};
+    }
+
     private static File buildDestinationFile( File buildDir, String uri )
     {
         return new File( buildDir, uri );
@@ -219,4 +303,25 @@ public class EarMojo
             archive.setManifestFile( customManifestFile );
         }
     }
+
+    /**
+     * 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();
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 06/16: PR: MNG-1402 Submitted by: Tomislav Stojcevich Reviewed by: Stephane Nicoll Fixed compliance of generated application.xml (display-name and description different in 1.3 and 1.4)

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit 47599284f9c975ffe64f010ebcbb8a345a9d7a3c
Author: Stephane Nicoll <sn...@apache.org>
AuthorDate: Sat Nov 5 07:31:29 2005 +0000

    PR: MNG-1402
    Submitted by: Tomislav Stojcevich
    Reviewed by: Stephane Nicoll
    Fixed compliance of generated application.xml (display-name and description different in 1.3 and 1.4)
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@330981 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/plugin/ear/ApplicationXmlWriter.java     | 30 ++++++++++++++--------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java b/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
index 9f1e2a3..b2c8ac8 100644
--- a/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ear/ApplicationXmlWriter.java
@@ -70,35 +70,45 @@ public final class ApplicationXmlWriter
         if ( GenerateApplicationXmlMojo.VERSION_1_3.equals( version ) )
         {
             writer = initializeRootElementOneDotThree( w );
+            writeDisplayName(displayName, writer);
+            writeDescription(description, writer);
         }
         else if ( GenerateApplicationXmlMojo.VERSION_1_4.equals( version ) )
         {
             writer = initializeRootElementOneDotFour( w );
+            writeDescription(description, writer);
+            writeDisplayName(displayName, writer);
         }
 
+        Iterator i = earModules.iterator();
+        while ( i.hasNext() )
+        {
+            EarModule module = (EarModule) i.next();
+            module.appendModule( writer, version );
+        }
+        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();
         }
-
-        Iterator i = earModules.iterator();
-        while ( i.hasNext() )
-        {
-            EarModule module = (EarModule) i.next();
-            module.appendModule( writer, version );
-        }
-        writer.endElement();
-
-        close( w );
     }
 
     private void close( Writer closeable )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-ear-plugin] 05/16: PR: MNG-1296 Submitted by: Edwin Punzalan Reviewed by: Brett Porter use scope filter and optional flag instead of hard coding

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-ear-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ear-plugin.git

commit be0c28359b76aecfa6530373b6bbd75642b42d99
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Mon Oct 24 04:16:41 2005 +0000

    PR: MNG-1296
    Submitted by: Edwin Punzalan
    Reviewed by:  Brett Porter
    use scope filter and optional flag instead of hard coding
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk/maven-plugins/maven-ear-plugin@327955 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java b/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
index 8bb7c67..167851c 100644
--- a/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
+++ b/src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
@@ -27,6 +27,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
 
 /**
  * A base class for EAR-processing related tasks.
@@ -102,9 +103,9 @@ public abstract class AbstractEarMojo
             Artifact artifact = (Artifact) iter.next();
 
             // Artifact is not yet registered and it has neither test, nor a
-            // provided scope
-            if ( !isArtifactRegistered( artifact, allModules ) && !Artifact.SCOPE_TEST.equals( artifact.getScope() ) &&
-                !Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) )
+            // 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 );
                 allModules.add( module );

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.