aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Hammar2011-08-01 17:09:08 (EDT)
committerIgor Fedorenko2011-08-03 08:41:59 (EDT)
commitc1e54b60f36735e3ea6ee299633c386ced9ae988 (patch)
treec1fdef6719030a346ef4b85e0aaa0e2f77eb1368
parentd36e0d4507745afdab62ba9315d7db6d0696c854 (diff)
downloadm2e-core-c1e54b60f36735e3ea6ee299633c386ced9ae988.zip
m2e-core-c1e54b60f36735e3ea6ee299633c386ced9ae988.tar.gz
m2e-core-c1e54b60f36735e3ea6ee299633c386ced9ae988.tar.bz2
343927: Set project file encoding based on project.build.sourceEncoding property
Signed-off-by: Anders Hammar <anders@hammar.net>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
index 9cd4ab6..0cd641f 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
@@ -287,6 +287,13 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
addMavenNature(project, monitor);
+ // Configure project file encoding
+ MavenProject mavenProject = request.getMavenProject();
+ Properties mavenProperties = mavenProject.getProperties();
+ String sourceEncoding = mavenProperties.getProperty("project.build.sourceEncoding");
+ log.debug("Setting encoding for project {}: {}", project.getName(), sourceEncoding); //$NON-NLS-1$
+ project.setDefaultCharset(sourceEncoding, monitor);
+
ILifecycleMapping lifecycleMapping = getLifecycleMapping(mavenProjectFacade);
if(lifecycleMapping != null) {