Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2012-05-20 13:29:05 -0400
committerIgor Fedorenko2012-05-20 13:29:05 -0400
commit9c7d64c5d7d53480b12d6b06eaad966492cb3355 (patch)
tree83afd9ff209244437357d45e83e3775f40280725
parent0fcd714ad71be4425786714ceec14b24221aef13 (diff)
downloadm2e-core-9c7d64c5d7d53480b12d6b06eaad966492cb3355.tar.gz
m2e-core-9c7d64c5d7d53480b12d6b06eaad966492cb3355.tar.xz
m2e-core-9c7d64c5d7d53480b12d6b06eaad966492cb3355.zip
343568 MavenDependencies classpath container is empty if some <dependency/> elements are invalid
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java2
2 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
index c326775e..4d775a5a 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
@@ -585,9 +585,14 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
result.setProject(projectBuildingResult.getProject());
result.setDependencyResolutionResult(projectBuildingResult.getDependencyResolutionResult());
} catch(ProjectBuildingException ex) {
- return result.addException(ex);
+ if(ex.getResults() != null && ex.getResults().size() == 1) {
+ ProjectBuildingResult projectBuildingResult = ex.getResults().get(0);
+ result.setProject(projectBuildingResult.getProject());
+ result.setDependencyResolutionResult(projectBuildingResult.getDependencyResolutionResult());
+ }
+ result.addException(ex);
} catch(MavenExecutionRequestPopulationException ex) {
- return result.addException(ex);
+ result.addException(ex);
} finally {
log.debug("Read Maven project: {} in {} ms", pomFile.getAbsoluteFile(), System.currentTimeMillis() - start); //$NON-NLS-1$
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
index 340ecbe2..fb7f4100 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
@@ -638,8 +638,8 @@ public class ProjectRegistryManager {
}
MarkerUtils.addEditorHintMarkers(markerManager, pom, mavenProject, IMavenConstants.MARKER_POM_LOADING_ID);
+ markerManager.addMarkers(pom, IMavenConstants.MARKER_POM_LOADING_ID, mavenResult);
if (mavenProject == null) {
- markerManager.addMarkers(pom, IMavenConstants.MARKER_POM_LOADING_ID, mavenResult);
return null;
}

Back to the top