mentallurg - created MECLIPSE-741:
-------------------------------------

             Summary: JARs put to the root of EAR instead of lib
                 Key: MECLIPSE-741
                 URL: https://jira.codehaus.org/browse/MECLIPSE-741
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: WTP support
    Affects Versions: 2.9, 2.8
         Environment: - Maven 3.0.5.
- Eclipse "Juno SR 1" 
- Oracle JDK 1.6.0.45 64-bit
- Windows 7 64-bit

            Reporter: mentallurg -
            Priority: Critical


The pom.xml of EAR module defines a "lib" directory for JARs:
{{  <defaultLibBundleDir>lib</defaultLibBundleDir>}}
eclipse:eclipse generates org.eclipse.wst.common.component with errors. Each 
JAR is prepended with "../".
Example:
{{  <dependent-module archiveName="../log4j-1.2.16.jar" deploy-path="lib"  }}
"../" means that this JAR will be put to "lib/../", i.e. to the root of EAR. 
When application is started, then JARs are not found under "lib" and the 
application fails to start.

If deployment assembly is created manually in Eclipse, configuration looks as 
follows:
{{  <dependent-module archiveName="log4j-1.2.16.jar" deploy-path="lib"  }}
Then Eclipse puts JARs to the lib within EAR:
lib/log4j-1.2.16.jar
This is correct, applications starts and works correctly.


The prefix "../" should be removed from the archiveName.


According to the source code of AbstractWtpResourceWriter.java:
{quote}
// This is a very ugly hack around a WTP bug! a delpoydir in the configuration 
file is duplicated.
// a deploy dir like "lib" will be used as "lib/lib" the only workig workaround 
is to include a ..
// in the archive name.
archiveName = "../" + artifactPath.getName();
{quote}

There is no info, what bug is meant. May be this? 
https://issues.sonatype.org/browse/MNGECLIPSE-2150. But was fixed in 2010.
Instead of fixing a bug this peace of code just produces a _new bug_.

*Solution:* The "../" prefix should not be added to the archiveName.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to