Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-04-21 11:53:35 -0400
committerIgor Fedorenko2011-04-21 11:53:35 -0400
commit8e465f10e2e4739b7a6fe8ebd1ed117ef8435073 (patch)
tree1491019b8ade2c9a30f74ad40442b1e29db115ca
parent02d54276dd0bf9f477801cccfd452e15dc840106 (diff)
downloadm2e-core-8e465f10e2e4739b7a6fe8ebd1ed117ef8435073.tar.gz
m2e-core-8e465f10e2e4739b7a6fe8ebd1ed117ef8435073.tar.xz
m2e-core-8e465f10e2e4739b7a6fe8ebd1ed117ef8435073.zip
343530 - pom.xml changes are ignored in some cases
Added logic to attempt to force-read project facade if it is null. This covers situation when the user fixes broken pom.xml, saves it and expects m2e to clear relevant error markers. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
index 075ed16a..f706c9b3 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
@@ -113,13 +113,11 @@ public class MavenBuilder extends IncrementalProjectBuilder {
return null;
}
+ IResourceDelta delta = getDelta(project);
+
IMavenProjectFacade projectFacade = projectManager.create(getProject(), monitor);
- if(projectFacade == null) {
- // XXX is this really possible? should we warn the user?
- return null;
- }
- if(projectFacade.isStale()) {
+ if(delta == null || projectFacade == null || projectFacade.isStale()) {
MavenUpdateRequest updateRequest = new MavenUpdateRequest(project, mavenConfiguration.isOffline() /*offline*/,
false /*updateSnapshots*/);
projectManager.refresh(updateRequest, monitor);
@@ -152,10 +150,9 @@ public class MavenBuilder extends IncrementalProjectBuilder {
projectFacade.getResolverConfiguration(), monitor);
MavenSession session = maven.createSession(request, mavenProject);
- IResourceDelta delta = getDelta(project);
Map<String, Object> contextState = (Map<String, Object>) project.getSessionProperty(BUILD_CONTEXT_KEY);
AbstractEclipseBuildContext buildContext;
- if(contextState != null && (INCREMENTAL_BUILD == kind || AUTO_BUILD == kind)) {
+ if(delta != null && contextState != null && (INCREMENTAL_BUILD == kind || AUTO_BUILD == kind)) {
buildContext = new EclipseIncrementalBuildContext(delta, contextState);
} else {
// must be full build

Back to the top