mirror of https://github.com/apache/maven.git
Initial revision
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162724 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
74c31684be
commit
4e0e3236d9
|
@ -0,0 +1,6 @@
|
|||
*~
|
||||
*.log
|
||||
target
|
||||
*.ipr
|
||||
*.iws
|
||||
*.iml
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<project>
|
||||
<parent>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-plugin-parent</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>maven-plugin-plugin</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<name>Maven</name>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<inceptionYear>2001</inceptionYear>
|
||||
<package>org.apache.maven</package>
|
||||
</project>
|
|
@ -0,0 +1,36 @@
|
|||
package org.apache.maven.plugin.plugin;
|
||||
|
||||
import org.apache.maven.plugin.AbstractPlugin;
|
||||
import org.apache.maven.plugin.PluginExecutionRequest;
|
||||
import org.apache.maven.plugin.PluginExecutionResponse;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public abstract class AbstractPluginMojo
|
||||
extends AbstractPlugin
|
||||
{
|
||||
protected abstract void generate( String sourceDirectory, String outputDirectory, String pom )
|
||||
throws Exception;
|
||||
|
||||
public void execute( PluginExecutionRequest request, PluginExecutionResponse response )
|
||||
throws Exception
|
||||
{
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
String sourceDirectory = (String) request.getParameter( "sourceDirectory" );
|
||||
|
||||
String outputDirectory = (String) request.getParameter( "outputDirectory" );
|
||||
|
||||
String pom = (String) request.getParameter( "pom" );
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
generate( sourceDirectory, outputDirectory, pom );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package org.apache.maven.plugin.plugin;
|
||||
|
||||
import org.apache.maven.plugin.generator.PluginDescriptorGenerator;
|
||||
|
||||
/**
|
||||
* @maven.plugin.id plugin
|
||||
* @maven.plugin.description A maven2 mojo for generating a plugin descriptor.
|
||||
*
|
||||
* @parameter sourceDirectory String true validator description
|
||||
* @parameter outputDirectory String true validator description
|
||||
* @parameter pom String true validator description
|
||||
*
|
||||
* @goal.name descriptor
|
||||
* @goal.descriptor.description Goal for generating a plugin descriptor.
|
||||
* @goal.descriptor.parameter sourceDirectory #project.build.sourceDirectory
|
||||
* @goal.descriptor.parameter outputDirectory #maven.build.dest/META-INF/maven
|
||||
* @goal.descriptor.parameter pom #project.getFile().getPath()
|
||||
|
||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class DescriptorGenerator
|
||||
extends AbstractPluginMojo
|
||||
{
|
||||
protected void generate( String sourceDirectory, String outputDirectory, String pom )
|
||||
throws Exception
|
||||
{
|
||||
PluginDescriptorGenerator generator = new PluginDescriptorGenerator();
|
||||
|
||||
generator.execute( sourceDirectory, outputDirectory, pom );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue