diff options
14 files changed, 108 insertions, 15 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 fd260b422..9d7e5a143 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 @@ -18,6 +18,12 @@ <p>Bug <a href='https://bugs.eclipse.org/373402'>373402</a>. NPE in ClasspathDependencyUtil when classpath container returns null for entries</p> <p>Bug <a href='https://bugs.eclipse.org/376504'>376504</a>. Incorrect error message on RAR/App Client Jar Import Wizard</p> <p>Bug <a href='https://bugs.eclipse.org/378507'>378507</a>. NPE when exporting an EAR if one of the modules is out of synch</p> - +<p>Bug <a href='https://bugs.eclipse.org/388538'>388538</a>. Jars with Main-class in MANIFEST located in lib dir are deployed as App clients</p> +<p>Bug <a href='https://bugs.eclipse.org/388557'>388557</a>. EAR libraries classpath container is not calculating correctly references with relative paths</p> +<p>Bug <a href='https://bugs.eclipse.org/388551'>388551</a>. Exported archive includes entries with absolute paths</p> +<p>Bug <a href='https://bugs.eclipse.org/388970'>388970</a>. NPE when modules of an EAR have no archive name in the .component file</p> +<p>Bug <a href='https://bugs.eclipse.org/388969'>388969</a>. Inconsistent behaviour in legacy Application Deployment Descriptor when modules are modified</p> +<p>Bug <a href='https://bugs.eclipse.org/389007'>389007</a>. Meta-files should not be considered module members</p> +<p>Bug <a href='https://bugs.eclipse.org/389006'>389006</a>. Inconsistency in ADD_TO_EAR property model</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 62e331b7c..0ea37ae49 100644 --- a/features/org.eclipse.jst.web_core.feature.patch/feature.properties +++ b/features/org.eclipse.jst.web_core.feature.patch/feature.properties @@ -32,6 +32,13 @@ Bug https://bugs.eclipse.org/373210 J2EEFlexProjDeployable.isSingleRootStructure Bug https://bugs.eclipse.org/373402 NPE in ClasspathDependencyUtil when classpath container returns null for entries\n\ Bug https://bugs.eclipse.org/376504 Incorrect error message on RAR/App Client Jar Import Wizard\n\ Bug https://bugs.eclipse.org/378507 NPE when exporting an EAR if one of the modules is out of synch\n\ +Bug https://bugs.eclipse.org/388538 Jars with Main-class in MANIFEST located in lib dir are deployed as App clients\n\ +Bug https://bugs.eclipse.org/388557 EAR libraries classpath container is not calculating correctly references with relative paths\n\ +Bug https://bugs.eclipse.org/388551 Exported archive includes entries with absolute paths\n\ +Bug https://bugs.eclipse.org/388970 NPE when modules of an EAR have no archive name in the .component file\n\ +Bug https://bugs.eclipse.org/388969 Inconsistent behaviour in legacy Application Deployment Descriptor when modules are modified\n\ +Bug https://bugs.eclipse.org/389007 Meta-files should not be considered module members\n\ +Bug https://bugs.eclipse.org/389006 Inconsistency in ADD_TO_EAR property model\n\ \n\ # "copyright" property - text of the "Feature Update Copyright" copyright=\ diff --git a/plugins/org.eclipse.jst.common.frameworks/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.common.frameworks/META-INF/MANIFEST.MF index 088ad9ae0..afd72e2de 100644 --- a/plugins/org.eclipse.jst.common.frameworks/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.jst.common.frameworks/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.jst.common.frameworks; singleton:=true -Bundle-Version: 1.1.502.qualifier +Bundle-Version: 1.1.503.qualifier Bundle-Vendor: %pluginVendor Bundle-Localization: plugin Export-Package: diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/AddMappedOutputFoldersParticipant.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/AddMappedOutputFoldersParticipant.java index bb614adb7..15476914c 100644 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/AddMappedOutputFoldersParticipant.java +++ b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/AddMappedOutputFoldersParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Red Hat and others. + * Copyright (c) 2009, 2012 Red Hat and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Red Hat - Initial API and implementation + * Roberto Sanchez (IBM) - Use relative path for mapped output folders *******************************************************************************/ package org.eclipse.jst.common.internal.modulecore; @@ -78,7 +79,7 @@ public class AddMappedOutputFoldersParticipant extends AbstractFlattenParticipan while(i.hasNext()) { IContainer next = i.next(); try { - new VirtualComponentFlattenUtility(list, this).addContainer(next, mapped.get(next)); + new VirtualComponentFlattenUtility(list, this).addContainer(next, mapped.get(next).makeRelative()); } catch( CoreException ce) {} } } diff --git a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF index 6eb3c3cdc..95430ccec 100644 --- a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.eclipse.jst.j2ee; singleton:=true -Bundle-Version: 1.1.504.qualifier +Bundle-Version: 1.1.505.qualifier Bundle-Activator: org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin Bundle-Vendor: %Bundle-Vendor.0 Bundle-Localization: plugin diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java index 9b79c0599..f479b8cf1 100644 --- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java +++ b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -566,7 +566,7 @@ public class JavaEEArchiveUtilities extends ArchiveFactoryImpl { wrapArchive(simpleArchive, new Path(J2EEConstants.WEBAPP_DD_URI)); return simpleArchive; } else if (lastSegment.endsWith(IJ2EEModuleConstants.JAR_EXT)) { - String libPath = null == archivePath ? null : archivePath.removeLastSegments(1).toPortableString(); + String libPath = null == archivePath ? null : archivePath.removeLastSegments(1).lastSegment(); // Do not look for main class in manifest.mf if jar is on lib directory of EAR 5 or above boolean skipDiscriminateMainClass = isNestedWithinEar5OrAbove && earLibDirectory!= null && earLibDirectory.equals(libPath); Object discriminateMainClass = simpleArchive.getArchiveOptions().getOption(DISCRIMINATE_MAIN_CLASS); 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 803e87432..5e60d04d0 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. + * Copyright (c) 2003, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -441,7 +441,7 @@ public class J2EEComponentClasspathContainer implements IClasspathContainer { // check if the referenced component is in the library directory IPath runtimePath = earRef.getRuntimePath().makeRelative(); boolean isInLibDir = libDirPath.equals(runtimePath); - if(!isInLibDir){ + if(!isInLibDir && earRef.getArchiveName() != null){ IPath fullPath = earRef.getRuntimePath().append(earRef.getArchiveName()); isInLibDir = fullPath.removeLastSegments(1).makeRelative().equals(libDirPath); } diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationOp.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationOp.java index f979a48db..0b141e351 100644 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationOp.java +++ b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/AddComponentToEnterpriseApplicationOp.java @@ -35,6 +35,7 @@ import org.eclipse.jst.j2ee.application.WebModule; import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent; import org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent; import org.eclipse.jst.j2ee.internal.ICommonEMFModule; +import org.eclipse.jst.j2ee.internal.J2EEConstants; import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; import org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper; @@ -58,6 +59,8 @@ import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsOp; import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; +import org.eclipse.wst.common.componentcore.resources.IVirtualFile; +import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; import org.eclipse.wst.common.componentcore.resources.IVirtualReference; import org.eclipse.wst.common.frameworks.datamodel.IDataModel; import org.eclipse.wst.common.internal.emf.resource.CompatibilityXMIResource; @@ -135,6 +138,15 @@ public class AddComponentToEnterpriseApplicationOp extends CreateReferenceCompon try { compse = StructureEdit.getStructureEditForWrite(wc.getProject()); final ReferencedComponent ref = findReferencedComponent(earwc, wc, se, compse); + + // Determine if the EAR project has deployment descriptor, if so, then force save. + IPath saveFlag = null; + IVirtualFolder rootFolder = ear.getRootFolder(); + IPath path = new Path(J2EEConstants.APPLICATION_DD_URI); + IVirtualFile vFile = rootFolder.getFile(path); + if(vFile.exists()) + saveFlag = IModelProvider.FORCESAVE; + earModel.modify(new Runnable() { public void run() { final ICommonApplication application = (ICommonApplication)earModel.getModelObject(); @@ -174,7 +186,7 @@ public class AddComponentToEnterpriseApplicationOp extends CreateReferenceCompon } } } - }, null); + }, saveFlag); } finally { if (compse != null) { compse.saveIfNecessary(monitor); diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationOperation.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationOperation.java index 798b2b54a..dd5df7ce2 100644 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationOperation.java +++ b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/RemoveComponentFromEnterpriseApplicationOperation.java @@ -16,12 +16,15 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; +import org.eclipse.jst.j2ee.internal.J2EEConstants; import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; import org.eclipse.jst.j2ee.model.IEARModelProvider; +import org.eclipse.jst.j2ee.model.IModelProvider; import org.eclipse.jst.j2ee.model.ModelProviderManager; import org.eclipse.jst.javaee.application.Application; import org.eclipse.jst.javaee.application.Module; @@ -35,6 +38,7 @@ import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentOperation; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; import org.eclipse.wst.common.componentcore.resources.IVirtualFile; +import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; import org.eclipse.wst.common.frameworks.datamodel.IDataModel; public class RemoveComponentFromEnterpriseApplicationOperation extends RemoveReferenceComponentOperation { @@ -62,6 +66,7 @@ public class RemoveComponentFromEnterpriseApplicationOperation extends RemoveRef return; J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(comp.getProject()); final IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(comp.getProject()); + final IVirtualComponent ear = (IVirtualComponent) this.model.getProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT); StructureEdit se = null; try { se = StructureEdit.getStructureEditForWrite(comp.getProject()); @@ -75,6 +80,15 @@ public class RemoveComponentFromEnterpriseApplicationOperation extends RemoveRef compse = StructureEdit.getStructureEditForWrite(wc.getProject()); if(compse != null) { final ReferencedComponent ref = AddComponentToEnterpriseApplicationOp.findReferencedComponent(earwc, wc, se, compse); + + // Determine if the EAR project has deployment descriptor, if so, then force save. + IPath saveFlag = null; + IVirtualFolder rootFolder = ear.getRootFolder(); + IPath path = new Path(J2EEConstants.APPLICATION_DD_URI); + IVirtualFile vFile = rootFolder.getFile(path); + if(vFile.exists()) + saveFlag = IModelProvider.FORCESAVE; + earModel.modify(new Runnable() { public void run() { ICommonApplication application = (ICommonApplication)earModel.getModelObject(); @@ -133,7 +147,7 @@ public class RemoveComponentFromEnterpriseApplicationOperation extends RemoveRef } } } - }, null); + }, saveFlag); } else { earModel.modify(new Runnable() { public void run() { diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java index 2541924b0..b69a05a41 100644 --- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java +++ b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java @@ -687,8 +687,13 @@ public class EARArtifactEdit extends EnterpriseArtifactEdit implements IArtifact try { runnable.run(); if( getWritableEdit() != null ){ - // Always save regardless of resource path passed - Artifactedits save resources as a unit - getWritableEdit().saveIfNecessary( new NullProgressMonitor() ); + + if(modelPath != null && modelPath.equals(IModelProvider.FORCESAVE)){ + getWritableEdit().save( new NullProgressMonitor() ); + }else{ + // Always save regardless of resource path passed - Artifactedits save resources as a unit + getWritableEdit().saveIfNecessary( new NullProgressMonitor() ); + } } } finally { diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java index 1c9572080..cd988d647 100644 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java +++ b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -421,7 +421,8 @@ public class J2EEModuleVirtualComponent extends VirtualComponent implements ICom if (tempEarRefs[j].getReferencedComponent().equals(moduleComponent)) { earRefs = tempEarRefs; foundRef = tempEarRefs[j]; - earArchiveURI = foundRef.getArchiveName(); + earArchiveURI = foundRef.getRuntimePath() == null?foundRef.getArchiveName(): + foundRef.getRuntimePath().append(foundRef.getArchiveName()).makeRelative().toString(); simplePath = earArchiveURI != null ? earArchiveURI .lastIndexOf("/") == -1 : true; //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java index 1049ca211..3ffc49512 100644 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java +++ b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java @@ -23,6 +23,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.jem.util.emf.workbench.ProjectUtilities; import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; +import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences; import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities; import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider; import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties; @@ -66,6 +67,8 @@ public class J2EEFacetProjectCreationDataModelProvider extends FacetProjectCreat IDataModel nestedJ2EEFacetDataModel = getJ2EEFacetModel(); if (nestedJ2EEFacetDataModel!=null) return nestedJ2EEFacetDataModel.getProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME); + }else if (propertyName.equals(ADD_TO_EAR)) { + return new Boolean( J2EEPlugin.getDefault().getJ2EEPreferences().getBoolean(J2EEPreferences.Keys.ADD_TO_EAR_BY_DEFAULT)); } return super.getDefaultProperty(propertyName); } diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java index 89393a473..aaa0bb8e8 100644 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java +++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java @@ -12,11 +12,14 @@ package org.eclipse.jst.j2ee.internal.deployables; import java.net.URL; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Properties; +import java.util.Set; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; @@ -38,6 +41,7 @@ import org.eclipse.jst.j2ee.internal.J2EEConstants; import org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyEnablement; import org.eclipse.jst.j2ee.internal.common.exportmodel.JEEHeirarchyExportParticipant; import org.eclipse.jst.j2ee.internal.common.exportmodel.JavaEESingleRootCallback; +import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants; import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities; import org.eclipse.jst.server.core.IApplicationClientModule; @@ -55,6 +59,7 @@ import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; import org.eclipse.wst.server.core.IModule; +import org.eclipse.wst.server.core.model.IModuleResource; import org.eclipse.wst.server.core.model.ModuleDelegate; import org.eclipse.wst.web.internal.deployables.FlatComponentDeployable; @@ -65,6 +70,8 @@ public class J2EEFlexProjDeployable extends FlatComponentDeployable implements IEnterpriseApplication, IApplicationClientModule, IConnectorModule, IEJBModule, IWebModule, IUtilityModule, IWebFragmentModule { + private Set<String> metaResources = null; + /** * Constructor for J2EEFlexProjDeployable. * @@ -73,6 +80,7 @@ public class J2EEFlexProjDeployable extends FlatComponentDeployable implements */ public J2EEFlexProjDeployable(IProject project, IVirtualComponent aComponent) { super(project, aComponent); + declareMetadataResources(); } /** @@ -251,4 +259,38 @@ public class J2EEFlexProjDeployable extends FlatComponentDeployable implements } return paths.toArray(new IPath[paths.size()]); } + + /** + * Retrieves the module members. The meta resources of project + * are filtered. + */ + @Override + + public IModuleResource[] members() throws CoreException { + List<IModuleResource> moduleResources = new ArrayList<IModuleResource>(); + IModuleResource[] resources = super.members(); + + + for(IModuleResource res : resources) + + if(!metaResources.contains(res.getName())) + moduleResources.add(res); + + + return moduleResources.toArray(new IModuleResource[moduleResources.size()]); + } + + + /** + * This method declares the .project and .settings paths as + * meta resources, so they can be filtered from the members. + * + */ + + private void declareMetadataResources() { + + metaResources = new HashSet<String>(); + metaResources.add(IJ2EEModuleConstants.META_PROJECT_PATH); + + } } diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java index 28a0a96aa..f64eeb706 100644 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java +++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/IJ2EEModuleConstants.java @@ -29,4 +29,6 @@ public interface IJ2EEModuleConstants extends IModuleConstants { public static final String JST_WEB_TEMPLATE = "template.jst.web"; //$NON-NLS-1$ public static final String WST_WEB_TEMPLATE = "template.wst.web"; //$NON-NLS-1$ public static final String JST_COMPONENT_FILE = "org.eclipse.wst.common.component";//$NON-NLS-1$ + + public static final String META_PROJECT_PATH = ".project";//$NON-NLS-1$ } |