[388704] Meta-files should not be considered module members
[388884] Inconsistent behaviour in legacy Application Deployment
Descriptor when modules are modified
[388885] NPE when modules of an EAR have no archive name in the
.component file
[389005] Inconsistency in ADD_TO_EAR property model
[389302] application.xml file is corrupted after importing an EAR
project
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 dd3ce66..c441d2d 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
@@ -34,5 +34,10 @@
<p>Bug <a href='https://bugs.eclipse.org/388555'>388555</a>. EAR libraries classpath container is not calculating correctly references with relative paths</p>
<p>Bug <a href='https://bugs.eclipse.org/388537'>388537</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/388549'>388549</a>. Exported archive includes entries with absolute paths</p>
+<p>Bug <a href='https://bugs.eclipse.org/388704'>388704</a>. Meta-files should not be considered module members</p>
+<p>Bug <a href='https://bugs.eclipse.org/388884'>388884</a>. Inconsistent behaviour in legacy Application Deployment Descriptor when modules are modified</p>
+<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>
</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 5affd5d..5c5c10c 100644
--- a/features/org.eclipse.jst.web_core.feature.patch/feature.properties
+++ b/features/org.eclipse.jst.web_core.feature.patch/feature.properties
@@ -48,6 +48,11 @@
Bug https://bugs.eclipse.org/388555 EAR libraries classpath container is not calculating correctly references with relative paths\n\
Bug https://bugs.eclipse.org/388537 Jars with Main-class in MANIFEST located in lib dir are deployed as App clients\n\
Bug https://bugs.eclipse.org/388549 Exported archive includes entries with absolute paths\n\
+Bug https://bugs.eclipse.org/388704 Meta-files should not be considered module members\n\
+Bug https://bugs.eclipse.org/388884 Inconsistent behaviour in legacy Application Deployment Descriptor when modules are modified\n\
+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\
\n\
# "copyright" property - text of the "Feature Update Copyright"
copyright=\
diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentImportOperation.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentImportOperation.java
index e3422fe..0433bab 100644
--- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentImportOperation.java
+++ b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/operations/EARComponentImportOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 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
@@ -20,6 +20,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jem.util.UIContextDetermination;
import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit;
import org.eclipse.jst.j2ee.datamodel.properties.IEARComponentImportDataModelProperties;
@@ -27,6 +28,7 @@
import org.eclipse.jst.j2ee.internal.archive.ArchiveWrapper;
import org.eclipse.jst.j2ee.internal.archive.ComponentArchiveSaveAdapter;
import org.eclipse.jst.j2ee.internal.archive.EARComponentArchiveSaveAdapter;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties;
import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties;
@@ -75,11 +77,17 @@
* the progress monitor to use to display progress
*/
@Override
- protected void doExecute(IProgressMonitor monitor) throws ExecutionException {
- super.doExecute(monitor);
+ protected void doExecute(IProgressMonitor monitor) throws ExecutionException {
ExecutionException firstNestedException = null;
- List modelsToImport = (List) model.getProperty(IEARComponentImportDataModelProperties.HANDLED_PROJECT_MODELS_LIST);
try {
+
+ if( UIContextDetermination.getCurrentContext() == UIContextDetermination.HEADLESS_CONTEXT ) {
+ J2EEComponentClasspathUpdater.getInstance().setSuspendPostChangeEvents(true);
+ }
+
+ super.doExecute(monitor);
+ List modelsToImport = (List) model.getProperty(IEARComponentImportDataModelProperties.HANDLED_PROJECT_MODELS_LIST);
+
IDataModel importModel = null;
// make sure the wars handle importing their own web libs
for (int i = modelsToImport.size() - 1; i > 0; i--) {
@@ -191,6 +199,10 @@
}
resetDisposeImportModels();
monitor.worked(DISPOSE_WORK);
+
+ if( UIContextDetermination.getCurrentContext() == UIContextDetermination.HEADLESS_CONTEXT ) {
+ J2EEComponentClasspathUpdater.getInstance().setSuspendPostChangeEvents(false);
+ }
}
if (firstNestedException != null) {
throw firstNestedException;
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 803e874..5e60d04 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 @@
// 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/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathUpdater.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathUpdater.java
index 9fce19a..b94fff8 100644
--- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathUpdater.java
+++ b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathUpdater.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 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
@@ -73,6 +73,8 @@
public class J2EEComponentClasspathUpdater implements IResourceChangeListener, IResourceDeltaVisitor, IDependencyGraphListener {
private static J2EEComponentClasspathUpdater instance = null;
+
+ private static boolean suspendPostChangeEvents = false;
private static boolean updateDependencyGraph = true;
@@ -425,10 +427,12 @@
}
break;
case IResourceChangeEvent.POST_CHANGE:
- scheduleJob = true;
- event.getDelta().accept(this);
- IResourceDelta[] d = event.getDelta().getAffectedChildren();
- findNode(d);
+ if(!suspendPostChangeEvents) {
+ scheduleJob = true;
+ event.getDelta().accept(this);
+ IResourceDelta[] d = event.getDelta().getAffectedChildren();
+ findNode(d);
+ }
break;
}
@@ -602,4 +606,12 @@
{
updateDependencyGraph = value;
}
+
+ public void setSuspendPostChangeEvents(boolean suspendAction) {
+ J2EEComponentClasspathUpdater.suspendPostChangeEvents = suspendAction;
+ }
+
+ public boolean isSuspendPostChangeEvents() {
+ return suspendPostChangeEvents;
+ }
}
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 f979a48..9423191 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
@@ -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
@@ -35,6 +35,7 @@
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.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 @@
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 @@
}
}
}
- }, 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 798b2b5..851c447 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
@@ -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
@@ -16,12 +16,15 @@
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.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 @@
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 @@
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 @@
}
}
}
- }, 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 2541924..3f0bf07 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 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
@@ -687,8 +687,13 @@
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/project/facet/J2EEFacetProjectCreationDataModelProvider.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/facet/J2EEFacetProjectCreationDataModelProvider.java
index fd49768..3405817 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.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;
@@ -64,8 +65,11 @@
public Object getDefaultProperty(String propertyName) {
if (EAR_PROJECT_NAME.equals(propertyName)) {
IDataModel nestedJ2EEFacetDataModel = getJ2EEFacetModel();
- if (nestedJ2EEFacetDataModel!=null)
+ 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 89393a4..bfa2bc1 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 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
@@ -12,11 +12,14 @@
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.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.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 @@
IEnterpriseApplication, IApplicationClientModule,
IConnectorModule, IEJBModule, IWebModule, IUtilityModule, IWebFragmentModule {
+ private Set<String> metaResources = null;
+
/**
* Constructor for J2EEFlexProjDeployable.
*
@@ -73,6 +80,7 @@
*/
public J2EEFlexProjDeployable(IProject project, IVirtualComponent aComponent) {
super(project, aComponent);
+ declareMetadataResources();
}
/**
@@ -251,4 +259,32 @@
}
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 28a0a96..68462a4 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
@@ -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
@@ -29,4 +29,6 @@
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$
}