| author | Rosendo Martinez | 2012-10-04 12:37:37 (EDT) |
|---|---|---|
| committer | Roberto Sanchez | 2012-10-04 12:37:37 (EDT) |
| commit | 365f1089332548acd90e2cbacc9da06025f3f5c2 (patch) (side-by-side diff) | |
| tree | 6bd2e5041bba56765a65c3d4607011eee35e90dc | |
| parent | 980df32cf44af47a0121204516b6179b47f71f69 (diff) | |
| download | webtools.javaee-365f1089332548acd90e2cbacc9da06025f3f5c2.zip webtools.javaee-365f1089332548acd90e2cbacc9da06025f3f5c2.tar.gz webtools.javaee-365f1089332548acd90e2cbacc9da06025f3f5c2.tar.bz2 | |
[391126] EAR libraries classpath container for Utility projects in lib does not contain jars in lib v201210041700
3 files changed, 24 insertions, 16 deletions
diff --git a/features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html b/features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html index c441d2d..7768010 100644 --- a/features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html +++ b/features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html @@ -39,5 +39,6 @@ <p>Bug <a href='https://bugs.eclipse.org/388885'>388885</a>. NPE when modules of an EAR have no archive name in the .component file</p> <p>Bug <a href='https://bugs.eclipse.org/389005'>389005</a>. Inconsistency in ADD_TO_EAR property model</p> <p>Bug <a href='https://bugs.eclipse.org/389302'>389302</a>. application.xml file is corrupted after importing an EAR project</p> +<p>Bug <a href='https://bugs.eclipse.org/391126'>391126</a>. EAR libraries classpath container for Utility projects in lib does not contain jars in lib </p> </body> </html>
\ No newline at end of file diff --git a/features/org.eclipse.jst.web_core.feature.patch/feature.properties b/features/org.eclipse.jst.web_core.feature.patch/feature.properties index 5c5c10c..825c5f9 100644 --- a/features/org.eclipse.jst.web_core.feature.patch/feature.properties +++ b/features/org.eclipse.jst.web_core.feature.patch/feature.properties @@ -53,6 +53,7 @@ Bug https://bugs.eclipse.org/388884 Inconsistent behaviour in legacy Application Bug https://bugs.eclipse.org/388885 NPE when modules of an EAR have no archive name in the .component file\n\ Bug https://bugs.eclipse.org/389005 Inconsistency in ADD_TO_EAR property model\n\ Bug https://bugs.eclipse.org/389302 application.xml file is corrupted after importing an EAR project\n\ +Bug https://bugs.eclipse.org/391126 EAR libraries classpath container for Utility projects in lib does not contain jars in lib\n\ \n\ # "copyright" property - text of the "Feature Update Copyright" copyright=\ diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java index 5e60d04..b0ddfc9 100644 --- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java +++ b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java @@ -419,7 +419,7 @@ public class J2EEComponentClasspathContainer implements IClasspathContainer { // or if it is the empty string, do nothing. if (libDir != null && libDir.trim().length() != 0) { IPath libDirPath = new Path(libDir).makeRelative(); - // check if the component itself is not in the library directory of this EAR - avoid cycles in the build patch + // check if the component itself is not in the library directory of this EAR - avoid cycles in the build path IVirtualReference ref = earComp.getReference(component.getName()); if(ref != null){ IPath refPath = ref.getRuntimePath(); @@ -433,24 +433,30 @@ public class J2EEComponentClasspathContainer implements IClasspathContainer { } } refPath = refPath.makeRelative(); - if (!libDirPath.equals(refPath)) { - // retrieve the referenced components from the EAR - IVirtualReference[] earRefs = earComp.getReferences(); - for (IVirtualReference earRef : earRefs) { - if(earRef.getDependencyType() == IVirtualReference.DEPENDENCY_TYPE_USES){ - // check if the referenced component is in the library directory - IPath runtimePath = earRef.getRuntimePath().makeRelative(); - boolean isInLibDir = libDirPath.equals(runtimePath); - if(!isInLibDir && earRef.getArchiveName() != null){ - IPath fullPath = earRef.getRuntimePath().append(earRef.getArchiveName()); - isInLibDir = fullPath.removeLastSegments(1).makeRelative().equals(libDirPath); - } - if (isInLibDir) { - libRefs.add(earRef); - } + boolean onlyBinary = false; + // If this component is in the library directory, we will allow only binary entries to be + // added, to avoid cycles in the build path + if (libDirPath.equals(refPath)) { + onlyBinary = true; + } + // retrieve the referenced components from the EAR + IVirtualReference[] earRefs = earComp.getReferences(); + for (IVirtualReference earRef : earRefs) { + if(earRef.getDependencyType() == IVirtualReference.DEPENDENCY_TYPE_USES){ + // check if the referenced component is in the library directory + IPath runtimePath = earRef.getRuntimePath().makeRelative(); + boolean isInLibDir = libDirPath.equals(runtimePath); + if(!isInLibDir && earRef.getArchiveName() != null){ + IPath fullPath = earRef.getRuntimePath().append(earRef.getArchiveName()); + isInLibDir = fullPath.removeLastSegments(1).makeRelative().equals(libDirPath); + } + if (isInLibDir) { + if (!onlyBinary || (onlyBinary && earRef.getReferencedComponent().isBinary())) + libRefs.add(earRef); } } } + //add EAR classpath container refs try { ClasspathLibraryExpander classpathLibExpander = new ClasspathLibraryExpander(earComp); |

