Permalink
Browse files

Rename -Dcmds in -Dgoals

  • Loading branch information...
skuro committed May 6, 2012
1 parent 1165551 commit 9e5a7ef78f264e41ff84a1794df86c8505f10d69
Showing with 15 additions and 16 deletions.
  1. +3 −3 README.md
  2. +12 −13 src/main/java/tk/skuro/maven/plan/PlanMojo.java
View
@@ -13,7 +13,7 @@ This is what a normal invokation would look like:
$ mvn plan:plan clean javadoc:javadoc package install site:site
[...]
- [INFO] --- plan-maven-plugin:1.0:plan (default-cli) @ plan-maven-plugin ---
+ [INFO] --- plan-maven-plugin:1.1:plan (default-cli) @ plan-maven-plugin ---
[INFO]
[INFO] Current lifecycle:
[INFO] pre-clean
@@ -71,8 +71,8 @@ This is what a normal invokation would look like:
Alternatively, you can specify a set of commands without actually executing them:
- $ mvn plan:plan -Dcmds=jar:jar
- [INFO] --- plan-maven-plugin:1.1-SNAPSHOT:plan (default-cli) @ plan-maven-plugin ---
+ $ mvn plan:plan -Dgoals=jar:jar
+ [INFO] --- plan-maven-plugin:1.1:plan (default-cli) @ plan-maven-plugin ---
[INFO]
[INFO] Execution plan:
[INFO] [-] org.apache.maven.plugins:maven-jar-plugin:jar (default-cli)
@@ -13,7 +13,6 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
-
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.context.Context;
@@ -70,38 +69,38 @@
* List of commands to use instead of those specified on the command line
* e.g. "{@code clean,install,war:war}"
*
- * @parameter expression="${cmds}"
+ * @parameter expression="${goals}"
*/
- protected List<String> commands = java.util.Collections.emptyList();
-
+ protected List<String> goals = java.util.Collections.emptyList();
+
private PlexusContainer container;
-
+
public void contextualize(Context context) throws ContextException {
container = (PlexusContainer)context.get(PlexusConstants.PLEXUS_KEY);
}
public void execute() throws MojoExecutionException {
- final MavenSession actualSession = 0 == commands.size() ?
+ final MavenSession actualSession = 0 == goals.size() ?
session : createCustomSession();
-
+
outputPlanForSession(actualSession);
}
-
+
private MavenSession createCustomSession() {
final MavenExecutionRequest request =
DefaultMavenExecutionRequest.copy(session.getRequest());
- request.setGoals(commands);
-
+ request.setGoals(goals);
+
final MavenExecutionResult result = new DefaultMavenExecutionResult();
-
+
final MavenSession custom = new MavenSession(
container, session.getRepositorySession(),
request, result);
custom.setProjects(session.getProjects());
custom.setCurrentProject(session.getCurrentProject());
custom.setParallel(session.isParallel());
custom.setProjectDependencyGraph(session.getProjectDependencyGraph());
-
+
return custom;
}
@@ -114,7 +113,7 @@ private void outputPlanForSession(MavenSession session) {
}
} catch (Throwable e) {
e.printStackTrace();
- }
+ }
}
private void outputPlan(MavenExecutionPlan plan) {

0 comments on commit 9e5a7ef

Please sign in to comment.