Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2014-09-30 14:52:49 -0400
committerFred Bricon2014-09-30 14:53:47 -0400
commitd6a903b7e4886d0ae8d24b4240d0fb93d78d51bb (patch)
treea0e842093e093675206e36d1b7885ea1cf4db6c9 /org.eclipse.m2e.core
parentab495e942fdb3b5d0652c8a3454118511b3c46cc (diff)
downloadm2e-core-d6a903b7e4886d0ae8d24b4240d0fb93d78d51bb.tar.gz
m2e-core-d6a903b7e4886d0ae8d24b4240d0fb93d78d51bb.tar.xz
m2e-core-d6a903b7e4886d0ae8d24b4240d0fb93d78d51bb.zip
343038 : support [name] template in project import
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Diffstat (limited to 'org.eclipse.m2e.core')
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java
index 883f8ce0..3e2a7d54 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java
@@ -39,6 +39,8 @@ public class ProjectImportConfiguration {
private static final String VERSION = "\\[version\\]"; //$NON-NLS-1$
+ private static final String NAME = "\\[name\\]"; //$NON-NLS-1$
+
/** resolver configuration bean */
private ResolverConfiguration resolverConfiguration;
@@ -90,10 +92,15 @@ public class ProjectImportConfiguration {
if(version == null && model.getParent() != null) {
version = model.getParent().getVersion();
}
+ String name = model.getName();
+ if(name == null || name.trim().isEmpty()) {
+ name = artifactId;
+ }
// XXX needs MavenProjectManager update to resolve groupId and version
return projectNameTemplate.replaceAll(GROUP_ID, cleanProjectNameComponent(groupId, true))
.replaceAll(ARTIFACT_ID, cleanProjectNameComponent(artifactId, true))
+ .replaceAll(NAME, cleanProjectNameComponent(name, true))
.replaceAll(VERSION, version == null ? "" : cleanProjectNameComponent(version, true)); //$NON-NLS-1$
}

Back to the top