mirror of https://github.com/apache/maven.git
turn into a maven plugin and add @tags for descriptor generation.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162708 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0a5f04c0a6
commit
0d54b2204f
|
@ -12,17 +12,4 @@
|
|||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
<package>org.apache.maven</package>
|
||||
<logo>/images/maven.gif</logo>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-components/maven-plugins/maven-clean-plugin</connection>
|
||||
<developerConnection>scm:cvs:ext:${maven.username}@cvs.apache.org:/home/cvs:maven-components/maven-plugins/maven-clean-plugin</developerConnection>
|
||||
<url>http://cvs.apache.org/viewcvs.cgi/maven/</url>
|
||||
</repository>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -19,14 +19,16 @@ package org.apache.maven.plugin;
|
|||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @plugin.id clean
|
||||
* @plugin.description A maven2 plugin which cleans the build
|
||||
* @plugin.instantiation singleton
|
||||
* @plugin.mode integrated
|
||||
* @maven.plugin.id clean
|
||||
* @maven.plugin.description A maven2 plugin which cleans the build
|
||||
*
|
||||
* @parameter failedOnError String true validator description
|
||||
* @parameter outputDirectory String true validator description
|
||||
*
|
||||
* @goal.name clean
|
||||
* @goal.clean.description Goal which cleans the build
|
||||
* @goal.clean.parameter failedOnError false
|
||||
* @goal.clean.outputDirectory #maven.build.dir
|
||||
* @goal.clean.parameter outputDirectory #maven.build.dir
|
||||
*
|
||||
* @author <a href="mailto:evenisse@maven.org">Emmanuel Venisse</a>
|
||||
* @version $Id$
|
||||
|
|
|
@ -1,11 +1,28 @@
|
|||
<plugin>
|
||||
<id>clean</id>
|
||||
<implementation>org.apache.maven.plugin.CleanPlugin</implementation>
|
||||
<instantiation-strategy>singleton</instantiation-strategy>
|
||||
<instantiationStrategy>singleton</instantiationStrategy>
|
||||
<mode>integrated</mode>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>failedOnError</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description>description </description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description>description </description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<goals>
|
||||
<goal>
|
||||
<name>clean</name>
|
||||
<description>Goal which cleans the build</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>failedOnError</name>
|
||||
|
@ -18,4 +35,4 @@
|
|||
</parameters>
|
||||
</goal>
|
||||
</goals>
|
||||
</plugin>
|
||||
</plugin>
|
|
@ -12,47 +12,11 @@
|
|||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
<package>org.apache.maven</package>
|
||||
<logo>/images/maven.gif</logo>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-components/maven-plugins/maven-compiler-plugin</connection>
|
||||
<developerConnection>scm:cvs:ext:${maven.username}@cvs.apache.org:/home/cvs:maven-components/maven-plugins/maven-compiler-plugin</developerConnection>
|
||||
<url>http://cvs.apache.org/viewcvs.cgi/maven/</url>
|
||||
</repository>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>xpp3</groupId>
|
||||
<artifactId>xpp3</artifactId>
|
||||
<version>1.1.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus</artifactId>
|
||||
<version>0.14-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-i18n</artifactId>
|
||||
<version>1.0-beta-2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>classworlds</groupId>
|
||||
<artifactId>classworlds</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-compiler</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -2,27 +2,33 @@ package org.apache.maven.plugin;
|
|||
|
||||
import org.codehaus.plexus.compiler.Compiler;
|
||||
import org.codehaus.plexus.compiler.CompilerError;
|
||||
import org.codehaus.plexus.compiler.javac.JavacCompiler;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @plugin.id compiler
|
||||
* @plugin.description A maven2 plugin which integrates the use of Maven2 with IntelliJ's IDEA
|
||||
* @maven.plugin.id compiler
|
||||
* @maven.plugin.description A maven2 plugin compiles project sources.
|
||||
*
|
||||
* @parameter <name> <type> <required> <validatator> <description>
|
||||
*
|
||||
* This may be on a per method basis
|
||||
* @parameter sourceDirectories String[] required validator
|
||||
* @parameter sourceDirectory String required validator
|
||||
* @parameter outputDirectory String required validator
|
||||
* @parameter classpathElements String[] required validator
|
||||
* @parameter compiler String required validator
|
||||
*
|
||||
* The goal would map to a method if multiple methods were allowed
|
||||
* @goal.name idea
|
||||
* @goal.idea.parameter project #project
|
||||
* @goal.name compile
|
||||
* @goal.compile.description Compiles application sources
|
||||
* @goal.compile.parameter sourceDirectory #project.build.sourceDirectory
|
||||
* @goal.compile.parameter outputDirectory #maven.build.dest
|
||||
* @goal.compile.parameter classpathElements #project.classpathElements
|
||||
*
|
||||
* @goal.name test:compile
|
||||
* @goal.test:compile.prereq compile
|
||||
* @goal.test:compile.description Compiles test sources
|
||||
* @goal.test:compile.parameter sourceDirectory #project.build.unitTestSourceDirectory
|
||||
* @goal.test:compile.parameter outputDirectory #maven.test.dest
|
||||
* @goal.test:compile.parameter classpathElements #project.classpathElements
|
||||
*
|
||||
* There could be threadsafe and non threadsafe versions of a compiler
|
||||
* plugin. The case where you instantiate a compiler plugin that maintains
|
||||
|
@ -40,7 +46,7 @@ import java.util.Map;
|
|||
public class CompilerPlugin
|
||||
extends AbstractPlugin
|
||||
{
|
||||
private Map compilers;
|
||||
private Compiler compiler = new JavacCompiler();
|
||||
|
||||
private boolean debug = false;
|
||||
|
||||
|
@ -68,8 +74,6 @@ public class CompilerPlugin
|
|||
return;
|
||||
}
|
||||
|
||||
Compiler compiler = (Compiler) compilers.get( compilerId );
|
||||
|
||||
List messages = compiler.compile( classpathElements, new String[]{sourceDirectory}, outputDirectory );
|
||||
|
||||
if ( debug )
|
||||
|
|
|
@ -1,51 +1,42 @@
|
|||
<plugin>
|
||||
<id>compiler</id>
|
||||
<implementation>org.apache.maven.plugin.CompilerPlugin</implementation>
|
||||
<instantiation-strategy>singleton</instantiation-strategy>
|
||||
<instantiationStrategy>singleton</instantiationStrategy>
|
||||
<mode>integrated</mode>
|
||||
<requirements>
|
||||
<requirement>
|
||||
<role>org.codehaus.plexus.compiler.Compiler</role>
|
||||
<field-name>compilers</field-name>
|
||||
</requirement>
|
||||
</requirements>
|
||||
|
||||
<!--
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>sourceDirectory</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>classpathElements</name>
|
||||
<type>String[]</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>compiler</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
||||
<goals>
|
||||
<goal>
|
||||
<name>compile</name>
|
||||
<expressions>
|
||||
<expression>#project.build.sourceDirectory</expression>
|
||||
<expression>#maven.build.dest</expression>
|
||||
<expression>#project.classpathElements</expression>
|
||||
<expression>javac</expression>
|
||||
</expressions>
|
||||
</goal>
|
||||
</goals>
|
||||
-->
|
||||
|
||||
<goals>
|
||||
<goal>
|
||||
<name>compile</name>
|
||||
<description>Compiles application sources</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>sourceDirectory</name>
|
||||
|
@ -59,17 +50,11 @@
|
|||
<name>classpathElements</name>
|
||||
<expression>#project.classpathElements</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>compiler</name>
|
||||
<expression>javac</expression>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</goal>
|
||||
<goal>
|
||||
<name>test:compile</name>
|
||||
<prereqs>
|
||||
<prereq>compile</prereq>
|
||||
</prereqs>
|
||||
<description>Compiles test sources</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>sourceDirectory</name>
|
||||
|
@ -83,60 +68,10 @@
|
|||
<name>classpathElements</name>
|
||||
<expression>#project.classpathElements</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>compiler</name>
|
||||
<expression>javac</expression>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</goal>
|
||||
</goals>
|
||||
|
||||
|
||||
<goals>
|
||||
<goal>
|
||||
<name>compile</name>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>sourceDirectory</name>
|
||||
<expression>#project.build.sourceDirectory</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<expression>#maven.build.dest</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>classpathElements</name>
|
||||
<expression>#project.classpathElements</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>compiler</name>
|
||||
<expression>javac</expression>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</goal>
|
||||
<goal>
|
||||
<name>test:compile</name>
|
||||
<prereqs>
|
||||
<prereq>compile</prereq>
|
||||
</prereqs>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>sourceDirectory</name>
|
||||
<expression>#project.build.unitTestSourceDirectory</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<expression>#maven.test.dest</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>classpathElements</name>
|
||||
<expression>#project.classpathElements</expression>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>compiler</name>
|
||||
<expression>javac</expression>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</goal>
|
||||
</goals>
|
||||
</plugin>
|
||||
</plugin>
|
|
@ -10,53 +10,5 @@
|
|||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<name>Maven</name>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
<package>org.apache.maven</package>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-components/maven-plugins/maven-jar-plugin</connection>
|
||||
<developerConnection>scm:cvs:ext:${maven.username}@cvs.apache.org:/home/cvs:maven-components/maven-plugins/maven-jar-plugin</developerConnection>
|
||||
<url>http://cvs.apache.org/viewcvs.cgi/maven/</url>
|
||||
</repository>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xpp3</groupId>
|
||||
<artifactId>xpp3</artifactId>
|
||||
<version>1.1.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus</artifactId>
|
||||
<version>0.14-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>classworlds</groupId>
|
||||
<artifactId>classworlds</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-compiler</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -68,6 +68,20 @@ import java.util.jar.JarOutputStream;
|
|||
import java.util.jar.Manifest;
|
||||
|
||||
/**
|
||||
* @maven.plugin.id jar
|
||||
* @maven.plugin.description Maven plugin to build jars
|
||||
*
|
||||
* @parameter jarName String true validator description
|
||||
* @parameter outputDirectory String true validator description
|
||||
* @parameter basedir String true validator description
|
||||
*
|
||||
* @goal.name jar
|
||||
* @goal.jar.description build a jar
|
||||
* @goal.jar.prereq test
|
||||
* @goal.jar.prereq resources
|
||||
* @goal.jar.parameter jarName #maven.final.name
|
||||
* @goal.jar.parameter outputDirectory #maven.build.dir
|
||||
* @goal.jar.parameter basedir #maven.build.dest
|
||||
*
|
||||
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
|
||||
* @version $Id$
|
||||
|
@ -80,17 +94,27 @@ import java.util.jar.Manifest;
|
|||
* maven.remote.group
|
||||
*/
|
||||
public class JarPlugin
|
||||
extends AbstractPlugin
|
||||
{
|
||||
private String jarName;
|
||||
|
||||
private String outputDirectory;
|
||||
|
||||
private String basedir;
|
||||
|
||||
public void execute()
|
||||
public void execute( PluginExecutionRequest request, PluginExecutionResponse response )
|
||||
throws Exception
|
||||
{
|
||||
File basedir = new File( this.basedir );
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
System.out.println( request.getParameter( "basedir" ) );
|
||||
|
||||
File basedir = new File( (String) request.getParameter( "basedir" ) );
|
||||
|
||||
String outputDirectory = (String) request.getParameter( "outputDirectory" );
|
||||
|
||||
String jarName = (String) request.getParameter( "jarName" );
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
|
||||
File jarFile = new File( new File( outputDirectory ), jarName + ".jar" );
|
||||
|
||||
|
|
|
@ -1,15 +1,35 @@
|
|||
<plugin>
|
||||
<id>jar</id>
|
||||
<implementation>org.apache.maven.plugin.JarPlugin</implementation>
|
||||
<instantiation-strategy>per-lookup</instantiation-strategy>
|
||||
<mode>field</mode>
|
||||
<instantiationStrategy>singleton</instantiationStrategy>
|
||||
<mode>integrated</mode>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>jarName</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description>description </description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description>description </description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>basedir</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description>description </description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<goals>
|
||||
<goal>
|
||||
<name>jar</name>
|
||||
<prereqs>
|
||||
<prereq>test</prereq>
|
||||
<prereq>resources</prereq>
|
||||
</prereqs>
|
||||
<description>build a jar</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>jarName</name>
|
||||
|
@ -24,6 +44,10 @@
|
|||
<expression>#maven.build.dest</expression>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<prereqs>
|
||||
<prereq>test</prereq>
|
||||
<prereq>resources</prereq>
|
||||
</prereqs>
|
||||
</goal>
|
||||
</goals>
|
||||
</plugin>
|
||||
</plugin>
|
|
@ -9,14 +9,8 @@
|
|||
<groupId>maven</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<name>Maven</name>
|
||||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<package>org.apache.maven</package>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-components/maven-plugins/maven-resources-plugin</connection>
|
||||
<developerConnection>scm:cvs:ext:${maven.username}@cvs.apache.org:/home/cvs:maven-components/maven-plugins/maven-resources-plugin</developerConnection>
|
||||
<url>http://cvs.apache.org/viewcvs.cgi/maven/</url>
|
||||
</repository>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
|
@ -33,43 +27,5 @@
|
|||
<artifactId>maven-project</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.0-beta-2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Plexus -->
|
||||
|
||||
<dependency>
|
||||
<groupId>xpp3</groupId>
|
||||
<artifactId>xpp3</artifactId>
|
||||
<version>1.1.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus</artifactId>
|
||||
<version>0.14-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-i18n</artifactId>
|
||||
<version>1.0-beta-2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>classworlds</groupId>
|
||||
<artifactId>classworlds</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-compiler</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -68,30 +68,46 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @maven.plugin.id resources
|
||||
* @maven.plugin.description Maven plugin to build jars
|
||||
*
|
||||
* @parameter outputDirectory String true validator description
|
||||
* @parameter resources List true validator description
|
||||
*
|
||||
* @goal.name resources
|
||||
* @goal.resources.description copy application resources
|
||||
* @goal.resources.parameter outputDirectory #maven.build.dest
|
||||
* @goal.resources.parameter resources #project.build.resources
|
||||
*
|
||||
* @goal.name test:resources
|
||||
* @goal.test:resources.description copy test resources
|
||||
* @goal.test:resources.parameter outputDirectory #maven.test.dest
|
||||
* @goal.test:resources.parameter resources #project.build.unitTest.resources
|
||||
*
|
||||
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
|
||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||
*
|
||||
* @version $Id$
|
||||
*
|
||||
* maven.jar.manifest.extensions.add
|
||||
* maven.jar.includes
|
||||
* maven.jar.excludes
|
||||
* maven.jar.index
|
||||
* maven.jar.compress
|
||||
* maven.remote.group
|
||||
*
|
||||
* @todo separate this into a resources plugin and jar plugin so that the resource
|
||||
* copying can be used as part of testing, right now the resources are being copied
|
||||
* directly into the JAR, need to make them available to testing.
|
||||
*/
|
||||
public class ResourcesPlugin
|
||||
extends AbstractPlugin
|
||||
{
|
||||
private String outputDirectory;
|
||||
|
||||
private List resources;
|
||||
|
||||
public void execute()
|
||||
public void execute( PluginExecutionRequest request, PluginExecutionResponse response )
|
||||
throws Exception
|
||||
{
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
String outputDirectory = (String) request.getParameter( "outputDirectory" );
|
||||
|
||||
List resources = (List) request.getParameter( "resources" );
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
for ( Iterator i = getJarResources( resources ).iterator(); i.hasNext(); )
|
||||
{
|
||||
ResourceEntry resourceEntry = (ResourceEntry) i.next();
|
||||
|
|
|
@ -1,11 +1,28 @@
|
|||
<plugin>
|
||||
<id>resource-copier</id>
|
||||
<id>resources</id>
|
||||
<implementation>org.apache.maven.plugin.ResourcesPlugin</implementation>
|
||||
<instantiation-strategy>per-lookup</instantiation-strategy>
|
||||
<mode>field</mode>
|
||||
<instantiationStrategy>singleton</instantiationStrategy>
|
||||
<mode>integrated</mode>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description>description </description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>resources</name>
|
||||
<type>List</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description>description </description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<goals>
|
||||
<goal>
|
||||
<name>resources</name>
|
||||
<description>copy application resources</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
|
@ -19,6 +36,7 @@
|
|||
</goal>
|
||||
<goal>
|
||||
<name>test:resources</name>
|
||||
<description>copy test resources</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
|
@ -31,4 +49,4 @@
|
|||
</parameters>
|
||||
</goal>
|
||||
</goals>
|
||||
</plugin>
|
||||
</plugin>
|
|
@ -9,49 +9,13 @@
|
|||
<groupId>maven</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<name>Maven</name>
|
||||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<package>org.apache.maven</package>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-components/maven-plugins/maven-surefire-plugin</connection>
|
||||
<developerConnection>scm:cvs:ext:${maven.username}@cvs.apache.org:/home/cvs:maven-components/maven-plugins/maven-surefire-plugin</developerConnection>
|
||||
<url>http://cvs.apache.org/viewcvs.cgi/maven/</url>
|
||||
</repository>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>surefire</groupId>
|
||||
<artifactId>surefire-booter</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xpp3</groupId>
|
||||
<artifactId>xpp3</artifactId>
|
||||
<version>1.1.3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus</artifactId>
|
||||
<version>0.14-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-i18n</artifactId>
|
||||
<version>1.0-beta-2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>classworlds</groupId>
|
||||
<artifactId>classworlds</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -9,20 +9,39 @@ import java.io.File;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @maven.plugin.id surefire
|
||||
* @maven.plugin.description A maven2 plugin which uses surefire as a test runner
|
||||
*
|
||||
* @parameter mavenRepoLocal String required validator
|
||||
* @parameter basedir String required validator
|
||||
* @parameter includes String required validator
|
||||
* @parameter excludes String required validator
|
||||
* @parameter classpathElements String[] required validator
|
||||
*
|
||||
* @goal.name test
|
||||
* @goal.test.description Run tests using surefire
|
||||
*
|
||||
* @goal.test.prereq test:compile
|
||||
* @goal.test.prereq resources
|
||||
* @goal.test.prereq test:resources
|
||||
*
|
||||
* @goal.test.parameter mavenRepoLocal #maven.repo.local
|
||||
* @goal.test.parameter basedir #basedir
|
||||
* @goal.test.parameter includes #project.build.unitTest.includes
|
||||
* @goal.test.parameter excludes #project.build.unitTest.excludes
|
||||
* @goal.test.parameter classpathElements #project.classpathElements
|
||||
|
||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||
* @version $Id$
|
||||
*
|
||||
* @todo make version of junit and surefire configurable
|
||||
* @todo make report to be produced configurable
|
||||
*/
|
||||
public class SurefirePlugin
|
||||
extends AbstractPlugin
|
||||
{
|
||||
|
||||
public void execute( PluginExecutionRequest request, PluginExecutionResponse response )
|
||||
throws Exception
|
||||
|
||||
//public void execute( String mavenRepoLocal, String basedir, List includes, List excludes, String[] classpathElements )
|
||||
// throws Exception
|
||||
{
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -1,16 +1,49 @@
|
|||
<plugin>
|
||||
<id>surefire</id>
|
||||
<implementation>org.apache.maven.test.SurefirePlugin</implementation>
|
||||
<instantiation-strategy>singleton</instantiation-strategy>
|
||||
<instantiationStrategy>singleton</instantiationStrategy>
|
||||
<mode>integrated</mode>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>mavenRepoLocal</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>basedir</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>includes</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>excludes</name>
|
||||
<type>String</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>classpathElements</name>
|
||||
<type>String[]</type>
|
||||
<required>false</required>
|
||||
<validator>validator</validator>
|
||||
<description></description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<goals>
|
||||
<goal>
|
||||
<name>test</name>
|
||||
<prereqs>
|
||||
<prereq>test:compile</prereq>
|
||||
<prereq>resources</prereq>
|
||||
<prereq>test:resources</prereq>
|
||||
</prereqs>
|
||||
<description>Run tests using surefire</description>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>mavenRepoLocal</name>
|
||||
|
@ -33,6 +66,11 @@
|
|||
<expression>#project.classpathElements</expression>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<prereqs>
|
||||
<prereq>test:compile</prereq>
|
||||
<prereq>resources</prereq>
|
||||
<prereq>test:resources</prereq>
|
||||
</prereqs>
|
||||
</goal>
|
||||
</goals>
|
||||
</plugin>
|
||||
</plugin>
|
Loading…
Reference in New Issue