Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
2.8, 2.9
-
None
-
None
-
- Maven 3.0.5.
- Eclipse "Juno SR 1"
- Oracle JDK 1.6.0.45 64-bit
- Windows 7 64-bit
Description
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:
// 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();
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.