o bumped to p-u:1.4.9 and removed PrettyPrintXMLWriter

o bumped to modello-maven-plugin:1.0-alpha-18
o added more pom's description 
o added distributionManagement
o improved pom readingness


git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@629094 13f79535-47bb-0310-9956-ffa450edef68
master
Vincent Siveton 2008-02-19 13:08:41 +00:00
parent 9aceb543fe
commit 8d0c57b545
10 changed files with 146 additions and 250 deletions

View File

@ -19,14 +19,19 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-tools</artifactId>
<version>2.4-SNAPSHOT</version>
</parent>
<artifactId>maven-plugin-testing-harness</artifactId>
<name>Maven Plugin Testing Mechanism</name>
<description>The Maven Plugin Testing Harness provides mechanisms to manage tests on Mojo.</description>
<dependencies>
<!-- maven -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
@ -37,44 +42,26 @@
<artifactId>maven-core</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
<!-- plexus -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>1.0-alpha-7</version>
</dependency>
<!-- misc -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<links>
<link>http://java.sun.com/j2se/1.4.2/docs/api/</link>
<link>http://maven.apache.org/ref/current/maven-project/apidocs/</link>
<link>http://maven.apache.org/ref/current/maven-plugin-api/apidocs/</link>
<link>http://maven.apache.org/ref/current/maven-artifact/apidocs/</link>
<link>http://plexus.codehaus.org/plexus-utils/apidocs/</link>
<link>http://www.junit.org/junit/javadoc/</link>
</links>
</configuration>
</plugin>
</plugins>
</reporting>
<build>
<plugins>
<plugin>

View File

@ -20,14 +20,18 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-plugin-tools</artifactId>
<groupId>org.apache.maven</groupId>
<version>2.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-plugin-tools-ant</artifactId>
<name>Maven Ant Plugin Tools</name>
<name>Maven Plugin Tool for Ant</name>
<description>Ant extractor plugin tool.</description>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@ -20,14 +20,18 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-plugin-tools</artifactId>
<groupId>org.apache.maven</groupId>
<version>2.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-plugin-tools-api</artifactId>
<name>Maven Plugin Tools APIs</name>
<description>The Maven Plugin Tools APIs provides APIs to extracte Maven 2 Plugins informations and generate documentation.</description>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@ -37,6 +37,7 @@ import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringInputStream;
import org.codehaus.plexus.util.StringOutputStream;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
import org.codehaus.plexus.util.xml.XMLWriter;
import org.w3c.tidy.Tidy;
@ -143,7 +144,7 @@ public class PluginXdocGenerator
w.startElement( "p" );
w.writeMarkup( mojoDescriptor.getPluginDescriptor().getGroupId() + ":"
+ mojoDescriptor.getPluginDescriptor().getArtifactId() + ":"
+ mojoDescriptor.getPluginDescriptor().getVersion() + ":" + mojoDescriptor.getFullGoalName() );
+ mojoDescriptor.getPluginDescriptor().getVersion() + ":" + mojoDescriptor.getGoal() );
w.endElement(); //p
w.startElement( "p" );

View File

@ -1,185 +0,0 @@
package org.apache.maven.tools.plugin.generator;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.io.PrintWriter;
import java.io.Writer;
/**
* Copied from plexus-utils 1.3-SNAPSHOT as we can't upgrade it yet.
* This class can be removed when a newer version of plexus-utils is included with Maven
*
* @see org.codehaus.plexus.util.xml.PrettyPrintXMLWriter
*/
public class PrettyPrintXMLWriter
extends org.codehaus.plexus.util.xml.PrettyPrintXMLWriter
{
private static final String LS = System.getProperty( "line.separator" );
private PrintWriter writer;
private String lineIndenter;
private int depth;
public PrettyPrintXMLWriter( PrintWriter writer, String lineIndenter )
{
this( writer, lineIndenter, null, null );
}
public PrettyPrintXMLWriter( Writer writer, String lineIndenter )
{
this( new PrintWriter( writer ), lineIndenter );
}
public PrettyPrintXMLWriter( PrintWriter writer )
{
this( writer, null, null );
}
public PrettyPrintXMLWriter( Writer writer )
{
this( new PrintWriter( writer ) );
}
public PrettyPrintXMLWriter( PrintWriter writer, String lineIndenter, String encoding, String doctype )
{
super( writer, lineIndenter, encoding, doctype );
setWriter( writer );
setLineIndenter( lineIndenter );
}
public PrettyPrintXMLWriter( Writer writer, String lineIndenter, String encoding, String doctype )
{
this( new PrintWriter( writer ), lineIndenter, encoding, doctype );
}
public PrettyPrintXMLWriter( PrintWriter writer, String encoding, String doctype )
{
this( writer, " ", encoding, doctype );
}
public PrettyPrintXMLWriter( Writer writer, String encoding, String doctype )
{
this( new PrintWriter( writer ), encoding, doctype );
}
/**
* Write a string to the underlying writer
*
* @param str
*/
private void write( String str )
{
getWriter().write( str );
}
/**
* Get the string used as line indenter
*
* @return the line indenter
*/
protected String getLineIndenter()
{
return lineIndenter;
}
/**
* Set the string used as line indenter
*
* @param lineIndenter
*/
protected void setLineIndenter( String lineIndenter )
{
this.lineIndenter = lineIndenter;
}
/**
* Write the end of line character (using system line separator)
* and start new line with indentation
*/
protected void endOfLine()
{
write( LS );
for ( int i = 0; i < getDepth(); i++ )
{
write( getLineIndenter() );
}
}
/**
* Set the underlying writer
*
* @param writer
*/
protected void setWriter( PrintWriter writer )
{
this.writer = writer;
}
/**
* Get the underlying writer
*
* @return the underlying writer
*/
protected PrintWriter getWriter()
{
return writer;
}
/**
* Set the current depth in the xml indentation
*
* @param depth
*/
protected void setDepth( int depth )
{
this.depth = depth;
}
/**
* Get the current depth in the xml indentation
*
* @return
*/
protected int getDepth()
{
return depth;
}
public void startElement( String name )
{
super.startElement( name );
setDepth( getDepth() + 1 );
}
public void endElement()
{
super.endElement();
setDepth( getDepth() - 1 );
}
}

View File

@ -27,10 +27,13 @@ import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.codehaus.plexus.component.repository.ComponentDependency;
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.XMLWriter;
/**
* Convenience methods to play with Maven plugins.
*
* @author jdcasey
* @version $Id$
*/
@ -41,11 +44,22 @@ public final class PluginUtils
// nop
}
/**
* @param basedir
* @param include
* @return list of included files with default SCM excluded files
*/
public static String[] findSources( String basedir, String include )
{
return PluginUtils.findSources( basedir, include, null );
}
/**
* @param basedir
* @param include
* @param exclude
* @return list of included files
*/
public static String[] findSources( String basedir, String include, String exclude )
{
DirectoryScanner scanner = new DirectoryScanner();
@ -53,12 +67,11 @@ public final class PluginUtils
scanner.setIncludes( new String[] { include } );
if ( !StringUtils.isEmpty( exclude ) )
{
// TODO: need default excludes in scanner
scanner.setExcludes( new String[] { exclude, "**/.svn/**" } );
scanner.setExcludes( new String[] { exclude, StringUtils.join( FileUtils.getDefaultExcludes(), "," ) } );
}
else
{
scanner.setExcludes( new String[] { "**/.svn/**" } );
scanner.setExcludes( FileUtils.getDefaultExcludes() );
}
scanner.scan();
@ -66,6 +79,10 @@ public final class PluginUtils
return scanner.getIncludedFiles();
}
/**
* @param w not null writer
* @param pluginDescriptor not null
*/
public static void writeDependencies( XMLWriter w, PluginDescriptor pluginDescriptor )
{
w.startElement( "dependencies" );
@ -90,6 +107,10 @@ public final class PluginUtils
w.endElement();
}
/**
* @param dependencies not null list of <code>Dependency</code>
* @return list of component dependencies
*/
public static List toComponentDependencies( List dependencies )
{
List componentDeps = new LinkedList();
@ -111,7 +132,12 @@ public final class PluginUtils
return componentDeps;
}
private static void element( XMLWriter w, String name, String value )
/**
* @param w not null writer
* @param name
* @param value
*/
public static void element( XMLWriter w, String name, String value )
{
w.startElement( name );

View File

@ -20,27 +20,31 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-plugin-tools</artifactId>
<groupId>org.apache.maven</groupId>
<version>2.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-plugin-tools-beanshell</artifactId>
<name>Maven Plugin Tools for Beanshell</name>
<name>Maven Plugin Tool for Beanshell</name>
<description>Beanshell extractor plugin tool.</description>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-tools-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-descriptor</artifactId>
</dependency>
<dependency>
<groupId>bsh</groupId>
<artifactId>bsh</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-descriptor</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -20,14 +20,18 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-plugin-tools</artifactId>
<groupId>org.apache.maven</groupId>
<version>2.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-plugin-tools-java</artifactId>
<name>Maven Plugin Tools for Java</name>
<name>Maven Plugin Tool for Java</name>
<description>Java extractor plugin tool.</description>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@ -20,20 +20,23 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-plugin-tools</artifactId>
<groupId>org.apache.maven</groupId>
<version>2.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-plugin-tools-model</artifactId>
<name>Maven Plugin Metadata Model</name>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<version>1.0-alpha-14</version>
<version>1.0-alpha-18</version>
<configuration>
<model>src/main/mdo/plugin-metadata.mdo</model>
<version>1.0.0</version>
@ -50,6 +53,7 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>

85
pom.xml
View File

@ -1,3 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
@ -17,32 +19,41 @@
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.apache.maven</groupId>
<version>7</version>
<relativePath>../pom/maven/pom.xml</relativePath>
</parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-tools</artifactId>
<packaging>pom</packaging>
<name>Maven Plugin Tools</name>
<version>2.4-SNAPSHOT</version>
<description>The Maven Plugin Tools contain the necessary tools to be able to produce Maven 2 Plugins in a variety of languages.</description>
<packaging>pom</packaging>
<name>Maven Plugin Tools</name>
<description>The Maven Plugin Tools contains the necessary tools to be able to produce Maven 2 Plugins in a variety of languages.</description>
<url>http://maven.apache.org/plugin-tools/</url>
<inceptionYear>2004</inceptionYear>
<prerequisites>
<maven>2.0.6</maven>
</prerequisites>
<issueManagement>
<system>jira</system>
<url>http://jira.codehaus.org/browse/MPLUGIN</url>
</issueManagement>
<inceptionYear>2004</inceptionYear>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-tools/trunk/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-tools/trunk/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/maven/plugin-tools/trunk</url>
</scm>
<mailingLists>
<mailingList>
<name>Maven User List</name>
@ -53,6 +64,7 @@
<otherArchives>
<otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive>
<otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive>
<otherArchive>http://maven.users.markmail.org/</otherArchive>
</otherArchives>
</mailingList>
<mailingList>
@ -61,38 +73,68 @@
<unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe>
<post>dev@maven.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
<otherArchives>
<otherArchive>http://www.mail-archive.com/dev@maven.apache.org/</otherArchive>
<otherArchive>http://www.nabble.com/Maven-Developers-f179.html</otherArchive>
<otherArchive>http://maven.dev.markmail.org/</otherArchive>
</otherArchives>
</mailingList>
<mailingList>
<name>Maven Issues List</name>
<subscribe>issues-subscribe@maven.apache.org</subscribe>
<unsubscribe>issues-unsubscribe@maven.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/maven-issues/</archive>
<otherArchives>
<otherArchive>http://www.mail-archive.com/issues@maven.apache.org</otherArchive>
<otherArchive>http://www.nabble.com/Maven---Issues-f15573.html</otherArchive>
<otherArchive>http://maven.issues.markmail.org/</otherArchive>
</otherArchives>
</mailingList>
<mailingList>
<name>Maven Commits List</name>
<subscribe>commits-subscribe@maven.apache.org</subscribe>
<unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe>
<post>commits@maven.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
<archive>http://mail-archives.apache.org/mod_mbox/maven-commits</archive>
<otherArchives>
<otherArchive>http://www.mail-archive.com/commits@maven.apache.org</otherArchive>
<otherArchive>http://www.nabble.com/Maven---Commits-f15575.html</otherArchive>
<otherArchive>http://maven.commits.markmail.org/</otherArchive>
</otherArchives>
</mailingList>
<!-- duplication from maven-parent pom - temporary until they inherit properly
-->
<!-- duplication from parent pom - temporary until they inherit properly -->
<mailingList>
<name>Maven Announcements List</name>
<post>announce@maven.apache.org</post>
<subscribe>announce-subscribe@maven.apache.org</subscribe>
<unsubscribe>announce-unsubscribe@maven.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/maven-announce/</archive>
</mailingList>
<mailingList>
<name>Maven Issues List</name>
<post>issues@maven.apache.org</post>
<subscribe>issues-subscribe@maven.apache.org</subscribe>
<unsubscribe>issues-unsubscribe@maven.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/maven-issues/</archive>
<otherArchives>
<otherArchive>http://www.mail-archive.com/announce@maven.apache.org</otherArchive>
<otherArchive>http://www.nabble.com/Maven-Announcements-f15617.html</otherArchive>
<otherArchive>http://maven.announce.markmail.org/</otherArchive>
</otherArchives>
</mailingList>
<mailingList>
<name>Maven Notifications List</name>
<post>notifications@maven.apache.org</post>
<subscribe>notifications-subscribe@maven.apache.org</subscribe>
<unsubscribe>notifications-unsubscribe@maven.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/maven-notifications/</archive>
<otherArchives>
<otherArchive>http://www.mail-archive.com/notifications@maven.apache.org</otherArchive>
<otherArchive>http://www.nabble.com/Maven---Notifications-f15574.html</otherArchive>
<otherArchive>http://maven.notifications.markmail.org/</otherArchive>
</otherArchives>
</mailingList>
</mailingLists>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scp://people.apache.org/www/maven.apache.org/plugin-tools/</url>
</site>
</distributionManagement>
<build>
<plugins>
<plugin>
@ -112,6 +154,7 @@
</plugins>
</pluginManagement>
</build>
<modules>
<module>maven-plugin-plugin</module>
<module>maven-plugin-tools-api</module>
@ -121,8 +164,10 @@
<module>maven-plugin-tools-ant</module>
<module>maven-plugin-testing-harness</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- maven -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-tools-api</artifactId>
@ -148,10 +193,12 @@
<artifactId>maven-plugin-descriptor</artifactId>
<version>2.0.5</version>
</dependency>
<!-- plexus -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.1</version>
<version>1.4.9</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>