229478 ComponentSaveStrategyImpl needs to respect deploy paths
diff --git a/features/org.eclipse.wst.common_core.feature.patch/buildnotes_org.eclipse.wst.common_core.feature.patch.html b/features/org.eclipse.wst.common_core.feature.patch/buildnotes_org.eclipse.wst.common_core.feature.patch.html
index 3bd4df7..da90fa5 100644
--- a/features/org.eclipse.wst.common_core.feature.patch/buildnotes_org.eclipse.wst.common_core.feature.patch.html
+++ b/features/org.eclipse.wst.common_core.feature.patch/buildnotes_org.eclipse.wst.common_core.feature.patch.html
@@ -19,4 +19,5 @@
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=209562'>209562</a>. J2EE DependencyGraphManager.metadataChanged() causing long delays</p>
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=215538'>215538</a>. Several problems with J2EE and Web Dependencies properties pages</p>
 <p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=229110'>229110</a>. ComponentUtilities.findFile() may cause ClassCastException</p>
+<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=229478'>229478</a>. ComponentSaveStrategyImpl needs to respect deploy paths</p>
 </body></html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.common_core.feature.patch/feature.properties b/features/org.eclipse.wst.common_core.feature.patch/feature.properties
index 9d51225..91e9932 100644
--- a/features/org.eclipse.wst.common_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.common_core.feature.patch/feature.properties
@@ -36,6 +36,7 @@
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=209562 DependencyGraphManager.metadataChanged() causing long delays\n\
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=215538 Several problems with J2EE and Web Dependencies properties pages\n\
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=229110 ComponentUtilities.findFile() may cause ClassCastException\n\
+Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=229478 ComponentSaveStrategyImpl needs to respect deploy paths\n\
 \n\
 
 # "copyright" property - text of the "Feature Update Copyright"
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/properties/ICreateReferenceComponentsDataModelProperties.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/properties/ICreateReferenceComponentsDataModelProperties.java
index 5030462..13137d7 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/properties/ICreateReferenceComponentsDataModelProperties.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/datamodel/properties/ICreateReferenceComponentsDataModelProperties.java
@@ -47,6 +47,17 @@
 	public static final String TARGET_COMPONENTS_DEPLOY_PATH = "ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_DEPLOY_PATH"; //$NON-NLS-1$
 
 	/**
+	 * <p>
+	 * This optional property is the {@link Map} containing keys of {@link IVirtualComponent}s and
+	 * values of {@link String}s. This map is used to specify the String which should be used by
+	 * the {@link IVirtualComponent} specified by the {@link #SOURCE_COMPONENT} property to lookup
+	 * the deploy path. The {@link Set} of {@link IVirtualComponent}s in the
+	 * keys of this {@link Map} should have the same contents as the {@link List}.
+	 * </p>
+	 */
+	public static final String TARGET_COMPONENTS_DEPLOY_PATH_MAP = "ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_DEPLOY_PATH_MAP"; //$NON-NLS-1$
+
+	/**
 	 * Optional, archive name for the dependent component, default is ""
 	 * 
 	 * @deprecated
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsDataModelProvider.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsDataModelProvider.java
index bf6e0c7..1e9d5ba 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsDataModelProvider.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsDataModelProvider.java
@@ -31,6 +31,7 @@
 		propertyNames.add(SOURCE_COMPONENT);
 		propertyNames.add(TARGET_COMPONENT_LIST);
 		propertyNames.add(TARGET_COMPONENTS_DEPLOY_PATH);
+		propertyNames.add(TARGET_COMPONENTS_DEPLOY_PATH_MAP);
 		propertyNames.add(TARGET_COMPONENT_ARCHIVE_NAME);
 		propertyNames.add(TARGET_COMPONENTS_TO_URI_MAP);
 		return propertyNames;
@@ -46,6 +47,11 @@
 			setProperty(propertyName, map);
 			return map;
 		}
+		else if (TARGET_COMPONENTS_DEPLOY_PATH_MAP.equals(propertyName)) {
+			Map map = new HashMap();
+			setProperty(propertyName, map);
+			return map;
+		}
 		
 		if (propertyName.equals(TARGET_COMPONENT_LIST))
 			return new ArrayList();
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsOp.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsOp.java
index 8ddc45c..955fdee 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsOp.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/operation/CreateReferenceComponentsOp.java
@@ -97,8 +97,10 @@
 		IVirtualComponent sourceComp = (IVirtualComponent) model.getProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT);
 		List vlist = new ArrayList();
 		List modList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
+		Map modDeployPathList = (Map) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH_MAP);
 		String deployPathStr = model.getStringProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH);
 		IPath deployPath = null;
+		IPath archiveDeployPath = null;
 		if (deployPathStr != null && deployPathStr.length() > 0){
 			deployPath = new Path(deployPathStr);
 		}
@@ -106,8 +108,17 @@
 			IVirtualComponent comp = (IVirtualComponent) modList.get(i);
 			if (!srcComponentContainsReference(sourceComp, comp, deployPath)) {
 				IVirtualReference ref = ComponentCore.createReference(sourceComp, comp);
-				if(deployPath != null){
-					ref.setRuntimePath(new Path(deployPathStr));
+				deployPathStr = (String)modDeployPathList.get(comp);
+				if (deployPathStr != null)
+				{
+					archiveDeployPath = new Path(deployPathStr);
+				}
+				else
+				{
+					archiveDeployPath = deployPath;
+				}
+				if(archiveDeployPath != null){
+					ref.setRuntimePath(archiveDeployPath);
 				}
 
 				String archiveName = getArchiveName(comp);