Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2018-07-06 06:12:48 -0400
committerFred Bricon2018-09-12 09:37:38 -0400
commitfda7930db940ecd44b8f22c08478f389aa26aaf3 (patch)
treec5f51dad0a677202e2b58b0d299a233b7fffb498
parentdb323d61161a055a1e5f200eada456650e2adddb (diff)
downloadm2e-core-fda7930db940ecd44b8f22c08478f389aa26aaf3.tar.gz
m2e-core-fda7930db940ecd44b8f22c08478f389aa26aaf3.tar.xz
m2e-core-fda7930db940ecd44b8f22c08478f389aa26aaf3.zip
Bug 536867 - Support maven mojos refreshing whole folder in BuildContext
Some mojos may need to refresh the whole project folder. This case currently throws an exception: java.lang.IllegalArgumentException: Path must include project and resource name: /org.eclipse.acute.netcoredbg.linux.x86_64 at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2117) at org.eclipse.core.internal.resources.Container.getFolder(Container.java:202) at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.refreshResources(MavenBuilderImpl.java:246) This patch prevents this exception from happening. Change-Id: I7326b46d58c33b93a29658e2dd1cae9dab606a0b Signed-off-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--m2e-maven-runtime/pom.xml2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/m2e-maven-runtime/pom.xml b/m2e-maven-runtime/pom.xml
index 573e6926..01c11275 100644
--- a/m2e-maven-runtime/pom.xml
+++ b/m2e-maven-runtime/pom.xml
@@ -34,7 +34,7 @@
<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
<osgi-version-qualifier>${maven.build.timestamp}</osgi-version-qualifier>
<maven-bundle-plugin.version>2.5.4</maven-bundle-plugin.version>
- <tycho.version>1.1.0</tycho.version>
+ <tycho.version>1.2.0</tycho.version>
<tycho-extras-version>${tycho.version}</tycho-extras-version>
</properties>
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java
index eee6de1b..a8d906bf 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java
@@ -240,7 +240,9 @@ public class MavenBuilderImpl {
}
IResource resource;
- if(!file.exists()) {
+ if(path.isEmpty()) {
+ resource = project;
+ } else if(!file.exists()) {
resource = project.findMember(path);
} else if(file.isDirectory()) {
resource = project.getFolder(path);

Back to the top