[ 
http://jira.codehaus.org/browse/MECLIPSE-360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Keith Naas updated MECLIPSE-360:
--------------------------------

    Attachment: MECLIPSE-360.patch

Path that fixes two issues with optional dependencies:

1. Optional WAR dependencies for WTP 1.5+ are not added as direct classpath 
dependencies.  Instead the WTP "org.eclipse.jst.j2ee.internal.module.container" 
classpath container is added automatically.  Since they are no longer direct 
dependencies, sources and javadocs are not defined in the .classpath file.  
Instead they will need to be added to a the workspaces 
".metadata/.plugins/org.eclipse.jst.j2eeclasspath.decorations.xml".  For 
example, 
 <classpath>
  <container id="org.eclipse.jst.j2ee.internal.module.container">
   <entry 
id="<absolutePathToM2_REPO>/commons-lang/commons-lang/2.3/commons-lang-2.3.jar">
    
<source-attachment-path><absolutePathToM2_REPO>/commons-lang/commons-lang/2.3/commons-lang-2.3-sources.jar</source-attachment-path>
    <attribute 
name="javadoc_location">jar:file:/<absolutePathToM2_REPO>/commons-lang/commons-lang/2.3/commons-lang-2.3-javadocs.jar!/</attribute>
   </entry>
  </container>
 </classpath>

2.  Optional WAR dependencies are not deployed to WEB-INF\lib.  This makes the 
packaging done by WTP consistent with the maven-war-plugin.

(Please note that this also includes a patch for MECLIPSE-284 since that was in 
my source tree as well).

> Optional web app dependencies are not treated the same way as maven-ear-plugin
> ------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-360
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-360
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: WTP support
>    Affects Versions: 2.5
>         Environment: eclipse 3.3.0, wtp 2.0.1, jboss 4.2.2
>            Reporter: Keith Naas
>         Attachments: MECLIPSE-360.patch
>
>
> Based on the information in 
> http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html, 
> we have dependencies declared in our EARs so that all dependencies reside in 
> the ear instead of being isolated (and duplicated) in each of the contained 
> war's "WEB-INF\lib".  This is done by declaring the war dependencies as 
> optional.  Proper manifest entries are added to the war, and the resulting 
> ear contains all of the necessary jars.   
> When running "mvn install" for such an ear project, the resulting ear is 
> created correctly.  
> When running "mvn eclipse:eclipse" for such an ear project, and then using 
> WTP to deploy the artificact to a server (e.g. tomcat or jboss), the 
> generated ear contains a war where all of those war optional dependencies are 
> packaged in the war.  This results in ClassLoader mayhem.  It appears that 
> this is happening because AbstractWtpResourceWriter adds the optional war 
> dependencies with a specific deployPath of "WEB-INF\lib".   To fix this, we 
> would need to either add the "optional" flag to the IDEDependency and then 
> use it withing AbstractWtpResourceWriter.writeWarOrEarResources to only use 
> assign a "WEB-INF\lib" deployDir if the IDEDepedency is not optional.
> I can make those changes and create a patch file so that the 
> maven-eclipse-plugin is made consistent with the maven-ear-plugin.

-- 
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

        

Reply via email to