Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2013-09-11 15:39:58 +0000
committerFred Bricon2013-09-11 15:39:58 +0000
commit182d4e0cd70f4d1379bd1d0a313660c8f7ae6249 (patch)
tree64f6bff660f31e7b5856adce47327ce3d18d53d2
parent297e2f620bee58a58aa4721734f06e7be83e753a (diff)
downloadorg.eclipse.m2e.wtp-1.0.x.tar.gz
org.eclipse.m2e.wtp-1.0.x.tar.xz
org.eclipse.m2e.wtp-1.0.x.zip
413925 : fix exception when regenerating application.xml1.0.x
Signed-off-by: Fred Bricon <fbricon@gmail.com>
-rw-r--r--org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenDeploymentDescriptorManagement.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenDeploymentDescriptorManagement.java b/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenDeploymentDescriptorManagement.java
index 1f2ff88..dc5cada 100644
--- a/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenDeploymentDescriptorManagement.java
+++ b/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenDeploymentDescriptorManagement.java
@@ -28,6 +28,7 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -176,7 +177,11 @@ public void updateConfiguration(IProject project, MavenProject mavenProject, Ear
try {
is = new FileInputStream(file);
IFile targetResource = metaInfFolder.getFile(file.getName());
- targetResource.create(is, true, monitor);
+ if (targetResource.exists()) {
+ targetResource.setContents(is, IResource.FORCE, monitor);
+ } else {
+ targetResource.create(is, true, monitor);
+ }
} catch (FileNotFoundException ex) {
IStatus status = new Status(IStatus.ERROR, MavenWtpPlugin.ID, IStatus.ERROR, ex.getMessage(), ex);
throw new CoreException(status);

Back to the top