[jira] Issue Comment Edited: (MEAR-85) ejb-client dependencies should be placed in defaultLibBundleDir

2010-01-31 Thread Stephane Nicoll (JIRA)

[ 
http://jira.codehaus.org/browse/MEAR-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=208723#action_208723
 ] 

Stephane Nicoll edited comment on MEAR-85 at 1/31/10 8:56 AM:
--

okay, due to the number of votes and since we seems to have a working solution 
that fit, I'll review and apply the patches in the upcoming version.

  was (Author: sni):
okay, due to the number of votes and a working solution that seems to fit 
to anyone, I'll review and apply the patches in the upcoming version.
  
 ejb-client dependencies should be placed in defaultLibBundleDir
 ---

 Key: MEAR-85
 URL: http://jira.codehaus.org/browse/MEAR-85
 Project: Maven 2.x Ear Plugin
  Issue Type: Bug
Affects Versions: 2.3.1
Reporter: James Olsen
Assignee: Stephane Nicoll
 Fix For: 2.4.1

 Attachments: MEAR-85-ashipilev-TESTS.patch, MEAR-85-ashipilev-v1.patch


 ejb-client jars should be placed in the defaultLibBundleDir when specified.  
 They're just standard jar dependencies not J2EE artifacts so should be 
 treated the same as other jars.  They're currently being placed in the root 
 directory.
 A workaround is to add an ejbClientModule entry to override the bundleDir:
 modules
   ejbClientModule
   groupId.../groupId
   artifactId.../artifactId
   bundleDirlib/bundleDir
   /ejbClientModule
 /modules

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Issue Comment Edited: (MEAR-85) ejb-client dependencies should be placed in defaultLibBundleDir

2010-01-07 Thread Aleksey Shipilev (JIRA)

[ 
http://jira.codehaus.org/browse/MEAR-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=205548#action_205548
 ] 

Aleksey Shipilev edited comment on MEAR-85 at 1/7/10 9:08 AM:
--

Is this better? I assume this does not break 1.3/1.4 behaviour but fixes 5/6:
{code}
Index: src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
===
--- src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java 
(revision 896892)
+++ src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java 
(working copy)
@@ -60,7 +60,7 @@
  * @return an ear module for this artifact
  * @throws UnknownArtifactTypeException if the artifact is not handled
  */
-public static EarModule newEarModule( Artifact artifact, String 
defaultLibBundleDir,
+public static EarModule newEarModule( Artifact artifact, String version, 
String defaultLibBundleDir,
   Boolean includeInApplicationXml )
 throws UnknownArtifactTypeException
 {
@@ -85,7 +85,12 @@
 }
 else if ( ejb-client.equals( artifactType ) )
 {
-return new EjbClientModule( artifact, null );
+// Somewhat weird way to tackle the problem described in MEAR-85
+if (AbstractEarMojo.VERSION_1_3.equals(version) || 
AbstractEarMojo.VERSION_1_4.equals(version)) {
+return new EjbClientModule( artifact, null );  
+} else {
+return new EjbClientModule( artifact, defaultLibBundleDir );
+}
 }
 else if ( rar.equals( artifactType ) )
 {
Index: src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
===
--- src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java  
(revision 896892)
+++ src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java  
(working copy)
@@ -223,7 +223,7 @@
 if ( !isArtifactRegistered( artifact, allModules )  
!artifact.isOptional() 
 filter.include( artifact ) )
 {
-EarModule module = EarModuleFactory.newEarModule( 
artifact, defaultLibBundleDir,
+EarModule module = EarModuleFactory.newEarModule( 
artifact, version, defaultLibBundleDir,
   
includeLibInApplicationXml );
 allModules.add( module );
 }
{code}

  was (Author: aleksey.shipilev):
Is this better? I assume this does not break 1.3/1.4 behaviour but fixes 
5/6:

Index: src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
===
--- src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java 
(revision 896892)
+++ src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java 
(working copy)
@@ -60,7 +60,7 @@
  * @return an ear module for this artifact
  * @throws UnknownArtifactTypeException if the artifact is not handled
  */
-public static EarModule newEarModule( Artifact artifact, String 
defaultLibBundleDir,
+public static EarModule newEarModule( Artifact artifact, String version, 
String defaultLibBundleDir,
   Boolean includeInApplicationXml )
 throws UnknownArtifactTypeException
 {
@@ -85,7 +85,12 @@
 }
 else if ( ejb-client.equals( artifactType ) )
 {
-return new EjbClientModule( artifact, null );
+// Somewhat weird way to tackle the problem described in MEAR-85
+if (AbstractEarMojo.VERSION_1_3.equals(version) || 
AbstractEarMojo.VERSION_1_4.equals(version)) {
+return new EjbClientModule( artifact, null );  
+} else {
+return new EjbClientModule( artifact, defaultLibBundleDir );
+}
 }
 else if ( rar.equals( artifactType ) )
 {
Index: src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java
===
--- src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java  
(revision 896892)
+++ src/main/java/org/apache/maven/plugin/ear/AbstractEarMojo.java  
(working copy)
@@ -223,7 +223,7 @@
 if ( !isArtifactRegistered( artifact, allModules )  
!artifact.isOptional() 
 filter.include( artifact ) )
 {
-EarModule module = EarModuleFactory.newEarModule( 
artifact, defaultLibBundleDir,
+EarModule module = EarModuleFactory.newEarModule( 
artifact, version, defaultLibBundleDir,
   
includeLibInApplicationXml );

[jira] Issue Comment Edited: (MEAR-85) ejb-client dependencies should be placed in defaultLibBundleDir

2009-08-16 Thread Jeff McClure (JIRA)

[ 
http://jira.codehaus.org/browse/MEAR-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=187289#action_187289
 ] 

Jeff McClure edited comment on MEAR-85 at 8/16/09 2:46 PM:
---

I was able to fix this issue with the following patch:

{code:title=patch} 
diff -rupN 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
--- 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
  2009-02-22 08:21:05.0 -0800
+++ 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 2009-08-16 12:39:46.0 -0700
@@ -85,7 +85,7 @@ public final class EarModuleFactory
 }
 else if ( ejb-client.equals( artifactType ) )
 {
-return new EjbClientModule( artifact, null );
+return new EjbClientModule( artifact, defaultLibBundleDir );
 }
 else if ( rar.equals( artifactType ) )
 {
{code} 

  was (Author: jeffmcclure):
I was able to fix this issue with the following patch:

{noformat} 
diff -rupN 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
--- 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
  2009-02-22 08:21:05.0 -0800
+++ 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 2009-08-16 12:39:46.0 -0700
@@ -85,7 +85,7 @@ public final class EarModuleFactory
 }
 else if ( ejb-client.equals( artifactType ) )
 {
-return new EjbClientModule( artifact, null );
+return new EjbClientModule( artifact, defaultLibBundleDir );
 }
 else if ( rar.equals( artifactType ) )
 {
{noformat} 
  
 ejb-client dependencies should be placed in defaultLibBundleDir
 ---

 Key: MEAR-85
 URL: http://jira.codehaus.org/browse/MEAR-85
 Project: Maven 2.x Ear Plugin
  Issue Type: Improvement
Affects Versions: 2.3.1
Reporter: James Olsen
Assignee: Stephane Nicoll
Priority: Minor
 Fix For: 2.5


 ejb-client jars should be placed in the defaultLibBundleDir when specified.  
 They're just standard jar dependencies not J2EE artifacts so should be 
 treated the same as other jars.  They're currently being placed in the root 
 directory.
 A workaround is to add an ejbClientModule entry to override the bundleDir:
 modules
   ejbClientModule
   groupId.../groupId
   artifactId.../artifactId
   bundleDirlib/bundleDir
   /ejbClientModule
 /modules

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Issue Comment Edited: (MEAR-85) ejb-client dependencies should be placed in defaultLibBundleDir

2009-08-16 Thread Jeff McClure (JIRA)

[ 
http://jira.codehaus.org/browse/MEAR-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=187289#action_187289
 ] 

Jeff McClure edited comment on MEAR-85 at 8/16/09 2:44 PM:
---

I was able to fix this issue with the following patch:

{noformat} 
diff -rupN 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
--- 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
  2009-02-22 08:21:05.0 -0800
+++ 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 2009-08-16 12:39:46.0 -0700
@@ -85,7 +85,7 @@ public final class EarModuleFactory
 }
 else if ( ejb-client.equals( artifactType ) )
 {
-return new EjbClientModule( artifact, null );
+return new EjbClientModule( artifact, defaultLibBundleDir );
 }
 else if ( rar.equals( artifactType ) )
 {
{noformat} 

  was (Author: jeffmcclure):
I was able to fix this issue with the following patch:

diff -rupN 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
--- 
maven-ear-plugin-2.3.2/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
  2009-02-22 08:21:05.0 -0800
+++ 
maven-ear-plugin-2.3.3-SNAPSHOT/src/main/java/org/apache/maven/plugin/ear/EarModuleFactory.java
 2009-08-16 12:39:46.0 -0700
@@ -85,7 +85,7 @@ public final class EarModuleFactory
 }
 else if ( ejb-client.equals( artifactType ) )
 {
-return new EjbClientModule( artifact, null );
+return new EjbClientModule( artifact, defaultLibBundleDir );
 }
 else if ( rar.equals( artifactType ) )
 {

  
 ejb-client dependencies should be placed in defaultLibBundleDir
 ---

 Key: MEAR-85
 URL: http://jira.codehaus.org/browse/MEAR-85
 Project: Maven 2.x Ear Plugin
  Issue Type: Improvement
Affects Versions: 2.3.1
Reporter: James Olsen
Assignee: Stephane Nicoll
Priority: Minor
 Fix For: 2.5


 ejb-client jars should be placed in the defaultLibBundleDir when specified.  
 They're just standard jar dependencies not J2EE artifacts so should be 
 treated the same as other jars.  They're currently being placed in the root 
 directory.
 A workaround is to add an ejbClientModule entry to override the bundleDir:
 modules
   ejbClientModule
   groupId.../groupId
   artifactId.../artifactId
   bundleDirlib/bundleDir
   /ejbClientModule
 /modules

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Issue Comment Edited: (MEAR-85) ejb-client dependencies should be placed in defaultLibBundleDir

2008-05-02 Thread Bryan Loofbourrow (JIRA)

[ 
http://jira.codehaus.org/browse/MEAR-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=133344#action_133344
 ] 

bryanloof edited comment on MEAR-85 at 5/2/08 10:38 AM:


The situation I have, simplified,  looks like this:

ear-project DEPENDS ON 
  jar-project DEPENDS ON 
ejb-project-1-client DEPENDS ON 
   ejb-project-2-client

In the ear project, jars are supposed to go into APP-INF/lib. I use 
defaultLibBundleDir, and it works for most things, but not ejb-client 
dependencues.  Apparently, the maven-ear-plugin takes any dependency specified 
with a classifier of ejb-client, and puts it into the root ot the ear, unless 
you tell it to do otherwise, for a specific artifact. This behavior contrasts 
with the usual jar-packaging behavior, in that defaultLibBundleDir permits 
specifying a default location for jars in general. 

As James Olsen says, specifying the jar-project's dependency as client instead 
of ejb-client evades the maven-ear-plugin's classification of the dependency as 
an ejb client, and therefore permits it to be packaged where 
defaultLibBundleDir says it should. That's all very fine for the jar-project 
DEPENDS ON ejb-project-1 case above. But what about the transitive dependency 
in my example above. ejb-project1-client DEPENDS-ON ejb-project-2-client? I may 
or may not control that dependency, and to the extent that I do not, what are 
my options?

If the only option at that point is to explicitly list all of the ejb-client 
artifacts on which I transitively depend, in the pom of every ear I build from 
jars that depend on clients with such transitive dependencies, then I suggest 
that this issue may be of greater import than its present classification of  
Minor/Improvement. Forcing projects to violate the hiding of transitive Maven 
dependencies seems reasonably serious.

Also, I've had a look in the maven-ear-plugin code, and it seems very easy to 
fix, at least if you agree with me about the right way to address it. Given 
that there's a defaultLibBundleDir for specifying the default location of jar 
files, and given that someone seems to have found a reason for putting ejb 
client jars somewhere else regardless of this setting, why not add a 
defaultEjbClientBundleDir parameter?  It looks to me as though the code change 
would be nearly trivial. There's even already a parameter for passing on a 
default packaging location, in constructing the object representing the 
ejb-client. It's just that it's always set to null at present.


  was (Author: bryanloof):
The situation I have, simplified,  looks like this:

ear-project DEPENDS ON jar-project DEPENDS ON OF ejb-project-1-client DEPENDS 
ON ejb-project-2-client

In the ear project, jars are supposed to go into APP-INF/lib. I use 
defaultLibBundleDir, and it works for most things, but not ejb-client 
dependencues.  Apparently, the maven-ear-plugin takes any dependency specified 
with a classifier of ejb-client, and puts it into the root ot the ear, unless 
you tell it to do otherwise, for a specific artifact. This behavior contrasts 
with the usual jar-packaging behavior, in that defaultLibBundleDir permits 
specifying a default location for jars in general. 

As James Olsen says, specifying the jar-project's dependency as client instead 
of ejb-client evades the maven-ear-plugin's classification of the dependency as 
an ejb client, and therefore permits it to be packaged where 
defaultLibBundleDir says it should. That's all very fine for the jar-project 
DEPENDS ON ejb-project-1 case above. But what about the transitive dependency 
in my example above. ejb-project1-client DEPENDS-ON ejb-project-2-client? I may 
or may not control that dependency, and to the extent that I do not, what are 
my options?

If the only option at that point is to explicitly list all of the ejb-client 
artifacts on which I transitively depend, in the pom of every ear I build from 
jars that depend on clients with such transitive dependencies, then I suggest 
that this issue may be of greater import than its present classification of  
Minor/Improvement. Forcing projects to violate the hiding of transitive Maven 
dependencies seems reasonably serious.

Also, I've had a look in the maven-ear-plugin code, and it seems very easy to 
fix, at least if you agree with me about the right way to address it. Given 
that there's a defaultLibBundleDir for specifying the default location of jar 
files, and given that someone seems to have found a reason for putting ejb 
client jars somewhere else regardless of this setting, why not add a 
defaultEjbClientBundleDir parameter?  It looks to me as though the code change 
would be nearly trivial. There's even already a parameter for passing on a 
default packaging location, in constructing the object representing the 
ejb-client. It's just that it's always set to null at present.

  
 ejb-client