Initial revision
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112724 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
3
console/.cvsignore
Normal file
3
console/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
target
|
||||
maven.log
|
||||
velocity.log
|
||||
64
console/plugin.jelly
Normal file
64
console/plugin.jelly
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:i="jelly:interaction"
|
||||
xmlns:log="jelly:log"
|
||||
xmlns:util="jelly:util">
|
||||
|
||||
<goal name="console" description="Run the Maven console">
|
||||
<attainGoal name="console:help"/>
|
||||
<j:set var="lastGoal" value="${maven.console.first}"/>
|
||||
<j:set var="followOn" value="true"/>
|
||||
<j:while test="${followOn}">
|
||||
<i:ask question="${pom.artifactId} ${pom.currentVersion} >" answer="goal" default="${lastGoal}"/>
|
||||
<j:choose>
|
||||
<j:when test="${goal.indexOf('=') != '-1'}">
|
||||
<util:tokenize var="propertyPieces" delim="=">${goal}</util:tokenize>
|
||||
<log:info>Setting property ${propertyPieces[0]} to ${propertyPieces[1]}</log:info>
|
||||
<j:set var="${propertyPieces[0]}" value="${propertyPieces[1]}" />
|
||||
</j:when>
|
||||
<j:when test="${goal=='help'}">
|
||||
<attainGoal name="console:help"/>
|
||||
</j:when>
|
||||
<j:when test="${goal=='list'}">
|
||||
<attainGoal name="console:listGoals"/>
|
||||
</j:when>
|
||||
<j:when test="${goal=='quit'}">
|
||||
<j:set var="followOn" value="false"/>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:catch var="ex">
|
||||
<util:tokenize var="goals" delim=" ,;">${goal}</util:tokenize>
|
||||
<j:forEach var="partGoal" items="${goals}">
|
||||
<attainGoal name="${partGoal}"/>
|
||||
</j:forEach>
|
||||
<j:set var="lastGoal" value="${goal}"/>
|
||||
</j:catch>
|
||||
<j:if test="${ex != null}">
|
||||
${ex}
|
||||
</j:if>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
<j:if test="${followOn=='false'}">
|
||||
Bye !
|
||||
</j:if>
|
||||
</j:while>
|
||||
</goal>
|
||||
|
||||
<goal name="console:listGoals" description="List all available goals">
|
||||
<j:set var="proj" value="${org.apache.commons.jelly.werkz.Project}"/>
|
||||
<j:forEach var="listGoal" items="${proj.goals}" trim="false">
|
||||
${listGoal.name}</j:forEach>
|
||||
</goal>
|
||||
|
||||
<goal name="console:help" description="Print the help message.">
|
||||
The following commands are available:
|
||||
|
||||
list - list all available goals
|
||||
help - this message
|
||||
<goalname> - attain a goal
|
||||
quit - quits the console
|
||||
|
||||
</goal>
|
||||
</project>
|
||||
10
console/plugin.properties
Normal file
10
console/plugin.properties
Normal file
@@ -0,0 +1,10 @@
|
||||
# -------------------------------------------------------------------
|
||||
# P L U G I N P R O P E R T I E S
|
||||
# -------------------------------------------------------------------
|
||||
# Xdoc plugin.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
# The name of the first goal that is displayed when entering the
|
||||
# console (defaults to "help"). The usage section is displayed in
|
||||
# any case).
|
||||
maven.console.first = ${maven.default.goal}
|
||||
59
console/project.xml
Normal file
59
console/project.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project>
|
||||
|
||||
<extend>${basedir}/../project.xml</extend>
|
||||
<pomVersion>3</pomVersion>
|
||||
<id>maven-console-plugin</id>
|
||||
<name>Maven Console Plug-in</name>
|
||||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
||||
|
||||
<shortDescription>Console for Maven</shortDescription>
|
||||
|
||||
<url>http://jakarta.apache.org/turbine/maven/reference/plugins/console/</url>
|
||||
<issueTrackingUrl>http://jira.werken.com/BrowseProject.jspa?id=10030</issueTrackingUrl>
|
||||
<siteAddress>jakarta.apache.org</siteAddress>
|
||||
<siteDirectory>/www/jakarta.apache.org/turbine/maven/reference/plugins/console/</siteDirectory>
|
||||
<distributionDirectory>/www/jakarta.apache.org/builds/jakarta-turbine-maven/</distributionDirectory>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>James Birchfield</name>
|
||||
<id>moatas</id>
|
||||
<email>jim@bnainc.net</email>
|
||||
<organization>Birchfield &amp; Associates, Inc.</organization>
|
||||
<roles>
|
||||
<role>Java Developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>dIon Gillard</name>
|
||||
<id>dion</id>
|
||||
<email>dion@multitask.com.au</email>
|
||||
<organization>Multitask Consulting</organization>
|
||||
<roles>
|
||||
<role>Documentation</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<id>commons-jelly+tags-interaction</id>
|
||||
<version>SNAPSHOT</version>
|
||||
<properties>
|
||||
<classloader>root.maven</classloader>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<id>commons-jelly+tags-log</id>
|
||||
<version>SNAPSHOT</version>
|
||||
<properties>
|
||||
<classloader>root.maven</classloader>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
1
console/xdocs/.cvsignore
Normal file
1
console/xdocs/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
stylesheets
|
||||
21
console/xdocs/changes.xml
Normal file
21
console/xdocs/changes.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
<properties>
|
||||
<title>Changes</title>
|
||||
<author email="dion@multitask.com.au">dIon Gillard</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<release version="1.0" date="in CVS">
|
||||
<action dev="smor" type="add">
|
||||
We can now set the first goal to be set as default when starting the
|
||||
console. This way, a project can set its own default goal, so that
|
||||
you doesn't have to "guess" what he is supposed to do.
|
||||
</action>
|
||||
<action dev="dion" type="add" due-to="Jim Birchfield">
|
||||
Plugin graciously donated by Jim
|
||||
</action>
|
||||
</release>
|
||||
</body>
|
||||
</document>
|
||||
|
||||
33
console/xdocs/goals.xml
Normal file
33
console/xdocs/goals.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Console Goals</title>
|
||||
<author email="dion@multitask.com.au">dIon Gillard</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Goals">
|
||||
<table>
|
||||
<tr><th>Goal</th><th>Description</th></tr>
|
||||
<tr>
|
||||
<td>console</td>
|
||||
<td>
|
||||
This is the default goal of the plugin and starts the console
|
||||
awaiting input.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>console:listGoals</td>
|
||||
<td>
|
||||
Lists the goals available for the currently loaded project
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>console:help</td>
|
||||
<td>Displays a help message along with a list of valid commands</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
36
console/xdocs/index.xml
Normal file
36
console/xdocs/index.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Console</title>
|
||||
<author email="dion@multitask.com.au">dIon Gillard</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Maven Console">
|
||||
<p>
|
||||
This plugin provides an interactive environment for executing
|
||||
Maven goals for a project. This cuts down on the JVM and Maven
|
||||
start-up times allowing for lightning-fast repetitive execution
|
||||
of Maven.
|
||||
</p>
|
||||
<p>
|
||||
The console simply loads the current project.xml and waits for
|
||||
the user to supply a goal (or other command) to execute. The
|
||||
following commands are currently implemented:
|
||||
<ul>
|
||||
<li>help - displays the valid commands for the console</li>
|
||||
<li>list - lists valid goals for the loaded project</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
For more information on the functionality provided by this plugin,
|
||||
please see the <a href="goals.html">Goals</a> document.
|
||||
</p>
|
||||
<p>
|
||||
You can customize some features with
|
||||
<a href="properties.html">properties</a>.
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
15
console/xdocs/navigation.xml
Normal file
15
console/xdocs/navigation.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project name="Maven Console Plugin">
|
||||
|
||||
<title>Maven Console</title>
|
||||
|
||||
<body>
|
||||
<links>
|
||||
<item name="Maven" href="http://jakarta.apache.org/turbine/maven/"/>
|
||||
</links>
|
||||
<menu name="Overview">
|
||||
<item name="Goals" href="/goals.html" />
|
||||
<item name="Properties" href="/properties.html"/>
|
||||
</menu>
|
||||
</body>
|
||||
</project>
|
||||
26
console/xdocs/properties.xml
Normal file
26
console/xdocs/properties.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Console Properties</title>
|
||||
<author email="smor@apache.org">Stéphane MOR</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Console Properties">
|
||||
<table>
|
||||
<tr><th>Property</th><th>Optional?</th><th>Description</th></tr>
|
||||
<tr>
|
||||
<td>maven.console.first</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Sets the name of the first default goal, which is displayed
|
||||
when the console starts.
|
||||
The default value is <code>${maven.default.goal}</code>.
|
||||
The help is displayed in any case.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
21
console/xdocs/tasks.xml
Normal file
21
console/xdocs/tasks.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Console Tasks</title>
|
||||
<author email="smor@hasgard.net">Stéphane MOR</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Tasks">
|
||||
<p>
|
||||
<ul>
|
||||
<li>
|
||||
Find a way to switch projects easily, so that
|
||||
we load all the plugins once for all projects.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
Reference in New Issue
Block a user