Skip to content

Commit 372eacb

Browse files
committed
Fix asking project properties twice
1 parent 5be254e commit 372eacb

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Version 2.4.1 (2017-02-17)
2+
3+
* [fix] Display the cause of the error when launching the application or a tool.
4+
* [fix] Fix asking for the generated project properties twice.
5+
16
# Version 2.4.0 (2017-02-09)
27

38
* [new] New goal `effective-config` to dump effective configuration of the project as YAML.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<groupId>org.seedstack</groupId>
2121
<artifactId>seedstack-maven-plugin</artifactId>
22-
<version>2.4.0-SNAPSHOT</version>
22+
<version>2.4.1-SNAPSHOT</version>
2323
<packaging>maven-plugin</packaging>
2424

2525
<properties>

src/license/THIRD-PARTY.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Please fill the missing licenses for dependencies :
1313
#
1414
#
15-
#Thu Feb 09 18:02:08 CET 2017
15+
#Fri Feb 17 11:27:48 CET 2017
1616
classworlds--classworlds--1.1-alpha-2=
1717
commons-collections--commons-collections--3.1=
1818
dom4j--dom4j--1.6.1=

src/main/java/org/seedstack/maven/GenerateMojo.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
112112
}
113113
}
114114

115-
// Using deprecated method to programmatically add a property to mojo execution
116-
mavenSession.getExecutionProperties().setProperty("version", version);
115+
mavenSession.getUserProperties().setProperty("version", version);
117116

118117
String groupId = mavenSession.getUserProperties().getProperty("groupId");
119118
String artifactId = mavenSession.getUserProperties().getProperty("artifactId");
@@ -128,15 +127,16 @@ public void execute() throws MojoExecutionException, MojoFailureException {
128127
throw new MojoExecutionException("Generated project group id and artifact id are required", e);
129128
}
130129

131-
mavenSession.getExecutionProperties().put("groupId", groupId);
132-
mavenSession.getExecutionProperties().put("artifactId", artifactId);
130+
mavenSession.getUserProperties().put("groupId", groupId);
131+
mavenSession.getUserProperties().put("artifactId", artifactId);
133132

134133
String pluginVersion;
135134
try {
136135
pluginVersion = artifactResolver.getHighestVersion(mavenProject, ARCHETYPE_PLUGIN_GROUP_ID, ARCHETYPE_PLUGIN_ARTIFACT_ID, false);
136+
getLog().info("Using the latest version of archetype plugin: " + pluginVersion);
137137
} catch (Exception e) {
138-
getLog().warn("Unable to determine latest version of archetype plugin, falling back to 2.4");
139-
pluginVersion = "2.4";
138+
getLog().warn("Unable to determine latest version of archetype plugin, falling back to 3.0.0");
139+
pluginVersion = "3.0.0";
140140
}
141141

142142
executeMojo(plugin(groupId(ARCHETYPE_PLUGIN_GROUP_ID), artifactId(ARCHETYPE_PLUGIN_ARTIFACT_ID), version(pluginVersion)),

src/main/java/org/seedstack/maven/runnables/DefaultLauncherRunnable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private Object getSeedLauncher() throws Exception {
5959
Method getLauncherMethod = Thread.currentThread().getContextClassLoader().loadClass(SeedStackConstants.mainClassName).getMethod("getLauncher");
6060
return getLauncherMethod.invoke(null);
6161
} catch (Exception e) {
62-
throw new MojoExecutionException("Seed application doesn't support launchers (you need at least Seed 2.1.0)");
62+
throw new MojoExecutionException("Cannot launch SeedStack application", e);
6363
}
6464
}
6565

src/main/java/org/seedstack/maven/runnables/ToolLauncherRunnable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private Object getToolLauncher() throws MojoExecutionException {
5656
Method getLauncherMethod = Thread.currentThread().getContextClassLoader().loadClass(SeedStackConstants.mainClassName).getMethod("getToolLauncher", String.class);
5757
return getLauncherMethod.invoke(null, tool);
5858
} catch (Exception e) {
59-
throw new MojoExecutionException("Seed application doesn't support tools (you need at least Seed 3.0.0)");
59+
throw new MojoExecutionException("Cannot launch SeedStack tool", e);
6060
}
6161
}
6262

0 commit comments

Comments
 (0)