You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/02/22 13:29:47 UTC
svn commit: r510478 [1/2] - in /maven/plugins/trunk/maven-ant-plugin: ./
src/main/java/org/apache/maven/plugin/ant/ src/site/fml/
src/test/java/org/apache/maven/plugin/ant/
src/test/java/org/apache/maven/plugin/ant/stubs/
src/test/resources/unit/ant-ja...
Author: vsiveton
Date: Thu Feb 22 04:29:45 2007
New Revision: 510478
URL: http://svn.apache.org/viewvc?view=rev&rev=510478
Log:
MANT-23: Make the ant plugin able to generate javadoc targets into build.xml files
o added writeJavadocTask()
o refactored the implementation to get Maven configuration
o added test cases
o update FAQ
Added:
maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/ArtifactResolverWrapper.java (with props)
maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/JavadocTestMavenProjectStub.java (with props)
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/pom.xml (with props)
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/App.java (with props)
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/resources/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/resources/main.txt (with props)
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/org/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/org/apache/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/org/apache/maven/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/org/apache/maven/plugins/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/org/apache/maven/plugins/ant/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/org/apache/maven/plugins/ant/test/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/java/org/apache/maven/plugins/ant/test/AppTest.java (with props)
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/resources/
maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/test/resources/test.txt (with props)
Modified:
maven/plugins/trunk/maven-ant-plugin/pom.xml
maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java
maven/plugins/trunk/maven-ant-plugin/src/site/fml/faq.fml
maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java
maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntMojoTest.java
maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
Modified: maven/plugins/trunk/maven-ant-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/pom.xml?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-ant-plugin/pom.xml Thu Feb 22 04:29:45 2007
@@ -51,8 +51,7 @@
<artifactId>maven-plugin-api</artifactId>
<version>2.0.2</version>
</dependency>
- <!-- For Maven 2.0.4
- -->
+ <!-- For Maven 2.0.4 -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -68,6 +67,7 @@
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>
+
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
@@ -213,4 +213,3 @@
</profile>
</profiles>
</project>
-
Modified: maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java (original)
+++ maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java Thu Feb 22 04:29:45 2007
@@ -77,6 +77,8 @@
private MavenProject project;
+ private ArtifactResolverWrapper artifactResolverWrapper;
+
private File localRepository;
private Settings settings;
@@ -85,14 +87,16 @@
/**
* @param project
- * @param localRepository
+ * @param artifactResolverWrapper
* @param settings
* @param overwrite
*/
- public AntBuildWriter( MavenProject project, File localRepository, Settings settings, boolean overwrite )
+ public AntBuildWriter( MavenProject project, ArtifactResolverWrapper artifactResolverWrapper, Settings settings,
+ boolean overwrite )
{
this.project = project;
- this.localRepository = localRepository;
+ this.artifactResolverWrapper = artifactResolverWrapper;
+ this.localRepository = new File( artifactResolverWrapper.getLocalRepository().getBasedir() );
this.settings = settings;
this.overwrite = overwrite;
}
@@ -187,6 +191,10 @@
}
}
+ addProperty( properties, "maven.test.reports", "${maven.build.dir}/test-reports" );
+
+ addProperty( properties, "maven.reporting.outputDirectory", "${maven.build.dir}/site" );
+
// ----------------------------------------------------------------------
// Settings properties
// ----------------------------------------------------------------------
@@ -283,6 +291,11 @@
writeTestTargets( writer, testCompileSourceRoots );
// ----------------------------------------------------------------------
+ // <target name="javadoc" />
+ // ----------------------------------------------------------------------
+ writeJavadocTarget( writer );
+
+ // ----------------------------------------------------------------------
// <target name="package" />
// ----------------------------------------------------------------------
writePackageTarget( writer );
@@ -471,6 +484,11 @@
writer.addAttribute( "value", "${maven.build.dir}/test-reports" );
writer.endElement(); // property
+ writer.startElement( "property" );
+ writer.addAttribute( "name", "maven.reporting.outputDirectory" );
+ writer.addAttribute( "value", "${maven.build.dir}/site" );
+ writer.endElement(); // property
+
// ----------------------------------------------------------------------
// Setting properties
// ----------------------------------------------------------------------
@@ -814,6 +832,42 @@
}
/**
+ * Write javadoc target in the writer depending the packaging of the project.
+ *
+ * @param writer
+ * @throws IOException if any
+ */
+ private void writeJavadocTarget( XMLWriter writer )
+ throws IOException
+ {
+ AntBuildWriterUtil.writeCommentText( writer, "Javadoc target", 1 );
+
+ writer.startElement( "target" );
+ writer.addAttribute( "name", "javadoc" );
+ writer.addAttribute( "description", "Generates the Javadoc of the application" );
+
+ if ( AntBuildWriterUtil.isPomPackaging( project ) )
+ {
+ if ( project.getModules() != null )
+ {
+ for ( Iterator it = project.getModules().iterator(); it.hasNext(); )
+ {
+ String moduleSubPath = (String) it.next();
+ AntBuildWriterUtil.writeAntTask( writer, project, moduleSubPath, "javadoc" );
+ }
+ }
+ }
+ else
+ {
+ AntBuildWriterUtil.writeJavadocTask( writer, project, artifactResolverWrapper );
+ }
+
+ writer.endElement(); // target
+
+ AntBuildWriterUtil.writeLineBreak( writer );
+ }
+
+ /**
* Write package target in the writer depending the packaging of the project.
*
* @param writer
@@ -882,7 +936,7 @@
writer.startElement( "target" );
writer.addAttribute( "name", synonym );
writer.addAttribute( "depends", "package" );
- writer.addAttribute( "description", "Builds the " + synonym + " for the application " );
+ writer.addAttribute( "description", "Builds the " + synonym + " for the application" );
writer.endElement(); //target
AntBuildWriterUtil.writeLineBreak( writer );
@@ -901,32 +955,34 @@
{
writer.startElement( "javac" );
writer.addAttribute( "destdir", outputDirectory );
- AntBuildWriterUtil.addWrapAttribute( writer, "javac", "includes", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "includes", null ), 3 );
- AntBuildWriterUtil.addWrapAttribute( writer, "javac", "excludes", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "excludes", null ), 3 );
+ Map[] includes = AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "includes", null );
+ AntBuildWriterUtil.addWrapAttribute( writer, "javac", "includes", getCommaSeparatedList( includes,
+ "include" ), 3 );
+ Map[] excludes = AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "excludes", null );
+ AntBuildWriterUtil.addWrapAttribute( writer, "javac", "excludes", getCommaSeparatedList( excludes,
+ "exclude" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "encoding", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "encoding", null ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "encoding", null ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "nowarn", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "showWarnings", "false" ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "showWarnings", "false" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "debug", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "debug", "true" ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "debug", "true" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "optimize", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "optimize", "false" ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "optimize", "false" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "deprecation", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "showDeprecation", "true" ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "showDeprecation", "true" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "target", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "target", null ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "target", null ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "verbose", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "verbose", "false" ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "verbose", "false" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "fork", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "fork", "false" ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "fork", "false" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "memoryMaximumSize", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "meminitial", null ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "meminitial", null ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "memoryInitialSize", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "maxmem", null ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "maxmem", null ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "source", AntBuildWriterUtil
- .getMavenCompilerPluginConfiguration( project, "source", null ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "source", null ), 3 );
String[] compileSourceRootsArray = (String[]) compileSourceRoots.toArray( new String[0] );
for ( int i = 0; i < compileSourceRootsArray.length; i++ )
@@ -1108,5 +1164,42 @@
private static void addProperty( Properties properties, String name, String value )
{
properties.put( name, StringUtils.isNotEmpty( value ) ? value : "" );
+ }
+
+ /**
+ * @param includes an array of includes or exludes map
+ * @param key a key wanted in the map, like <code>include</code> or <code>exclude</code>
+ * @return a String with comma-separated value of a key in each map
+ */
+ private static String getCommaSeparatedList( Map[] includes, String key )
+ {
+ if ( ( includes == null ) || ( includes.length == 0 ) )
+ {
+ return null;
+ }
+
+ StringBuffer sb = new StringBuffer();
+ for ( int i = 0; i < includes.length; i++ )
+ {
+ String s = (String) includes[i].get( key );
+ if ( StringUtils.isEmpty( s ) )
+ {
+ continue;
+ }
+
+ sb.append( s );
+
+ if ( i < ( includes.length - 1 ) )
+ {
+ sb.append( "," );
+ }
+ }
+
+ if ( sb.length() == 0 )
+ {
+ return null;
+ }
+
+ return sb.toString();
}
}
Modified: maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java (original)
+++ maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java Thu Feb 22 04:29:45 2007
@@ -24,15 +24,17 @@
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
-import java.util.StringTokenizer;
+import java.util.Map;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Plugin;
+import org.apache.maven.model.ReportPlugin;
import org.apache.maven.project.MavenProject;
import org.apache.maven.wagon.PathUtils;
import org.apache.xpath.XPathAPI;
@@ -42,6 +44,8 @@
import org.codehaus.plexus.util.xml.XMLWriter;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* Utility class for the <code>AntBuildWriter</code> class.
@@ -138,8 +142,7 @@
*/
public static void writeAntVersionHeader( XMLWriter writer )
{
- writeCommentText( writer, "Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above.",
- 0 );
+ writeCommentText( writer, "Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above.", 0 );
}
/**
@@ -250,7 +253,8 @@
}
/**
- * Convenience method to write XML comment between two comment line break. The XML comment block is also indented.
+ * Convenience method to write XML comment between two comment line break.
+ * The XML comment block is also indented.
*
* @param writer not null
* @param comment
@@ -295,7 +299,255 @@
}
/**
- * Convenience method to write XML jar task
+ * Convenience method to write XML Ant javadoc task
+ *
+ * @param writer not null
+ * @param project not null
+ * @param wrapper not null
+ * @throws IOException if any
+ */
+ public static void writeJavadocTask( XMLWriter writer, MavenProject project, ArtifactResolverWrapper wrapper )
+ throws IOException
+ {
+ List sources = new ArrayList();
+ for ( Iterator it = project.getCompileSourceRoots().iterator(); it.hasNext(); )
+ {
+ String source = (String) it.next();
+
+ if ( new File( source ).exists() )
+ {
+ sources.add( source );
+ }
+ }
+
+ // No sources
+ if ( sources.size() == 0 )
+ {
+ return;
+ }
+
+ writer.startElement( "javadoc" );
+ String sourcepath = getMavenJavadocPluginBasicOption( project, "sourcepath", null );
+ if ( sourcepath == null )
+ {
+ StringBuffer sb = new StringBuffer();
+ String[] compileSourceRoots = (String[]) sources.toArray( new String[0] );
+ for ( int i = 0; i < compileSourceRoots.length; i++ )
+ {
+ sb.append( "${maven.build.srcDir." ).append( i ).append( "}" );
+
+ if ( i < ( compileSourceRoots.length - 1 ) )
+ {
+ sb.append( File.pathSeparatorChar );
+ }
+ }
+ writer.addAttribute( "sourcepath", sb.toString() );
+ addWrapAttribute( writer, "javadoc", "packagenames", "*", 3 );
+ }
+ else
+ {
+ writer.addAttribute( "sourcepath", sourcepath );
+ }
+ addWrapAttribute( writer, "javadoc", "destdir",
+ getMavenJavadocPluginBasicOption( project, "destdir",
+ "${maven.reporting.outputDirectory}/apidocs" ), 3 );
+ addWrapAttribute( writer, "javadoc", "extdirs", getMavenJavadocPluginBasicOption( project, "extdirs", null ), 3 );
+
+ addWrapAttribute( writer, "javadoc", "overview", getMavenJavadocPluginBasicOption( project, "overview", null ),
+ 3 );
+ addWrapAttribute( writer, "javadoc", "access",
+ getMavenJavadocPluginBasicOption( project, "show", "protected" ), 3 );
+ addWrapAttribute( writer, "javadoc", "old", getMavenJavadocPluginBasicOption( project, "old", "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "verbose",
+ getMavenJavadocPluginBasicOption( project, "verbose", "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "locale", getMavenJavadocPluginBasicOption( project, "locale", null ), 3 );
+ addWrapAttribute( writer, "javadoc", "encoding", getMavenJavadocPluginBasicOption( project, "encoding", null ),
+ 3 );
+ addWrapAttribute( writer, "javadoc", "version", getMavenJavadocPluginBasicOption( project, "version", "true" ),
+ 3 );
+ addWrapAttribute( writer, "javadoc", "use", getMavenJavadocPluginBasicOption( project, "use", "true" ), 3 );
+ addWrapAttribute( writer, "javadoc", "author", getMavenJavadocPluginBasicOption( project, "author", "true" ), 3 );
+ addWrapAttribute( writer, "javadoc", "splitindex", getMavenJavadocPluginBasicOption( project, "splitindex",
+ "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "windowtitle", getMavenJavadocPluginBasicOption( project, "windowtitle",
+ null ), 3 );
+ addWrapAttribute( writer, "javadoc", "nodeprecated", getMavenJavadocPluginBasicOption( project, "nodeprecated",
+ "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "nodeprecatedlist", getMavenJavadocPluginBasicOption( project,
+ "nodeprecatedlist",
+ "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "notree", getMavenJavadocPluginBasicOption( project, "notree", "false" ),
+ 3 );
+ addWrapAttribute( writer, "javadoc", "noindex",
+ getMavenJavadocPluginBasicOption( project, "noindex", "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "nohelp", getMavenJavadocPluginBasicOption( project, "nohelp", "false" ),
+ 3 );
+ addWrapAttribute( writer, "javadoc", "nonavbar",
+ getMavenJavadocPluginBasicOption( project, "nonavbar", "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "serialwarn", getMavenJavadocPluginBasicOption( project, "serialwarn",
+ "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "helpfile", getMavenJavadocPluginBasicOption( project, "helpfile", null ),
+ 3 );
+ addWrapAttribute( writer, "javadoc", "stylesheetfile",
+ getMavenJavadocPluginBasicOption( project, "stylesheetfile", null ), 3 );
+ addWrapAttribute( writer, "javadoc", "charset", getMavenJavadocPluginBasicOption( project, "charset",
+ "ISO-8859-1" ), 3 );
+ addWrapAttribute( writer, "javadoc", "docencoding", getMavenJavadocPluginBasicOption( project, "docencoding",
+ null ), 3 );
+ addWrapAttribute( writer, "javadoc", "excludepackagenames",
+ getMavenJavadocPluginBasicOption( project, "excludepackagenames", null ), 3 );
+ addWrapAttribute( writer, "javadoc", "source", getMavenJavadocPluginBasicOption( project, "source", null ), 3 );
+ addWrapAttribute( writer, "javadoc", "linksource", getMavenJavadocPluginBasicOption( project, "linksource",
+ "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "breakiterator", getMavenJavadocPluginBasicOption( project,
+ "breakiterator",
+ "false" ), 3 );
+ addWrapAttribute( writer, "javadoc", "noqualifier", getMavenJavadocPluginBasicOption( project, "noqualifier",
+ null ), 3 );
+ // miscellaneous
+ addWrapAttribute( writer, "javadoc", "maxmemory",
+ getMavenJavadocPluginBasicOption( project, "maxmemory", null ), 3 );
+ addWrapAttribute( writer, "javadoc", "additionalparam", getMavenJavadocPluginBasicOption( project,
+ "additionalparam",
+ null ), 3 );
+
+ // Nested arg
+ String doctitle = getMavenJavadocPluginBasicOption( project, "doctitle", null );
+ if ( doctitle != null )
+ {
+ writer.startElement( "doctitle" );
+ writer.writeText( "<![CDATA[" + doctitle + "]]>" );
+ writer.endElement(); // doctitle
+ }
+ String header = getMavenJavadocPluginBasicOption( project, "header", null );
+ if ( header != null )
+ {
+ writer.startElement( "header" );
+ writer.writeText( "<![CDATA[" + header + "]]>" );
+ writer.endElement(); // header
+ }
+ String footer = getMavenJavadocPluginBasicOption( project, "footer", null );
+ if ( footer != null )
+ {
+ writer.startElement( "footer" );
+ writer.writeText( "<![CDATA[" + footer + "]]>" );
+ writer.endElement(); // footer
+ }
+ String bottom = getMavenJavadocPluginBasicOption( project, "bottom", null );
+ if ( bottom != null )
+ {
+ writer.startElement( "bottom" );
+ writer.writeText( "<![CDATA[" + bottom + "]]>" );
+ writer.endElement(); // bottom
+ }
+
+ Map[] links = getMavenJavadocPluginOptions( project, "links", null );
+ if ( links != null )
+ {
+ for ( int i = 0; i < links.length; i++ )
+ {
+ writer.startElement( "link" );
+ writer.addAttribute( "href", (String) links[i].get( "link" ) );
+ writer.endElement(); // link
+ }
+ }
+
+ Map[] offlineLinks = getMavenJavadocPluginOptions( project, "offlineLinks", null );
+ if ( offlineLinks != null )
+ {
+ for ( int i = 0; i < offlineLinks.length; i++ )
+ {
+ writer.startElement( "link" );
+ writer.addAttribute( "href", (String) offlineLinks[i].get( "url" ) );
+ addWrapAttribute( writer, "javadoc", "offline", "true", 4 );
+ writer.endElement(); // link
+ }
+ }
+
+ Map[] groups = getMavenJavadocPluginOptions( project, "groups", null );
+ if ( groups != null )
+ {
+ for ( int i = 0; i < groups.length; i++ )
+ {
+ writer.startElement( "group" );
+ writer.addAttribute( "title", (String) groups[i].get( "title" ) );
+ addWrapAttribute( writer, "javadoc", "package", (String) groups[i].get( "package" ), 4 );
+ writer.endElement(); // group
+ }
+ }
+
+ // TODO Handle docletArtifacts
+ String doclet = getMavenJavadocPluginBasicOption( project, "doclet", null );
+ if ( doclet != null )
+ {
+ String docletpath = getMavenJavadocPluginBasicOption( project, "docletpath", null );
+ if ( StringUtils.isNotEmpty( docletpath ) )
+ {
+ writer.startElement( "doclet" );
+ writer.addAttribute( "name", doclet );
+ addWrapAttribute( writer, "javadoc", "path", docletpath, 4 );
+ writer.endElement(); // doclet
+ }
+ else
+ {
+ Map docletArtifact = getMavenJavadocPluginOption( project, "docletArtifact", null );
+ String path = wrapper.getArtifactAbsolutePath( (String) docletArtifact.get( "groupId" ),
+ (String) docletArtifact.get( "artifactId" ),
+ (String) docletArtifact.get( "version" ) );
+ path = StringUtils.replace( path, wrapper.getLocalRepository().getBasedir(), "${maven.repo.local}" );
+
+ writer.startElement( "doclet" );
+ writer.addAttribute( "name", doclet );
+ addWrapAttribute( writer, "javadoc", "path", path, 4 );
+ writer.endElement(); // doclet
+ }
+ }
+
+ // TODO Handle taglets
+ String taglet = getMavenJavadocPluginBasicOption( project, "taglet", null );
+ if ( taglet != null )
+ {
+ String tagletpath = getMavenJavadocPluginBasicOption( project, "tagletpath", null );
+ if ( StringUtils.isNotEmpty( tagletpath ) )
+ {
+ writer.startElement( "taglet" );
+ writer.addAttribute( "name", taglet );
+ addWrapAttribute( writer, "javadoc", "path", tagletpath, 4 );
+ writer.endElement(); // taglet
+ }
+ else
+ {
+ Map tagletArtifact = getMavenJavadocPluginOption( project, "tagletArtifact", null );
+ String path = wrapper.getArtifactAbsolutePath( (String) tagletArtifact.get( "groupId" ),
+ (String) tagletArtifact.get( "artifactId" ),
+ (String) tagletArtifact.get( "version" ) );
+ path = StringUtils.replace( path, wrapper.getLocalRepository().getBasedir(), "${maven.repo.local}" );
+
+ writer.startElement( "taglet" );
+ writer.addAttribute( "name", taglet );
+ addWrapAttribute( writer, "javadoc", "path", path, 4 );
+ writer.endElement(); // taglet
+ }
+ }
+
+ Map[] tags = getMavenJavadocPluginOptions( project, "tags", null );
+ if ( tags != null )
+ {
+ for ( int i = 0; i < tags.length; i++ )
+ {
+ writer.startElement( "tag" );
+ writer.addAttribute( "name", (String) tags[i].get( "name" ) );
+ addWrapAttribute( writer, "javadoc", "scope", (String) tags[i].get( "placement" ), 4 );
+ addWrapAttribute( writer, "javadoc", "description", (String) tags[i].get( "head" ), 4 );
+ writer.endElement(); // tag
+ }
+ }
+
+ writer.endElement(); // javadoc
+ }
+
+ /**
+ * Convenience method to write XML Ant jar task
*
* @param writer not null
* @param project not null
@@ -306,24 +558,24 @@
{
writer.startElement( "jar" );
writer.addAttribute( "jarfile", "${maven.build.dir}/${maven.build.finalName}.jar" );
- addWrapAttribute( writer, "jar", "compress", getMavenJarPluginConfiguration( project, "archive//compress",
- "true" ), 3 );
- addWrapAttribute( writer, "jar", "index", getMavenJarPluginConfiguration( project, "archive//index", "false" ),
- 3 );
- if ( getMavenJarPluginConfiguration( project, "archive//manifestFile", null ) != null )
- {
- addWrapAttribute( writer, "jar", "manifest",
- getMavenJarPluginConfiguration( project, "archive//manifestFile", null ), 3 );
+ addWrapAttribute( writer, "jar", "compress",
+ getMavenJarPluginBasicOption( project, "archive//compress", "true" ), 3 );
+ addWrapAttribute( writer, "jar", "index", getMavenJarPluginBasicOption( project, "archive//index", "false" ), 3 );
+ if ( getMavenJarPluginBasicOption( project, "archive//manifestFile", null ) != null )
+ {
+ addWrapAttribute( writer, "jar", "manifest", getMavenJarPluginBasicOption( project,
+ "archive//manifestFile", null ),
+ 3 );
}
addWrapAttribute( writer, "jar", "basedir", "${maven.build.outputDir}", 3 );
addWrapAttribute( writer, "jar", "excludes", "**/package.html", 3 );
- if ( getMavenJarPluginConfiguration( project, "archive//manifest", null ) != null )
+ if ( getMavenJarPluginBasicOption( project, "archive//manifest", null ) != null )
{
writer.startElement( "manifest" );
writer.startElement( "attribute" );
writer.addAttribute( "name", "Main-Class" );
addWrapAttribute( writer, "attribute", "value",
- getMavenJarPluginConfiguration( project, "archive//manifest//mainClass", null ), 5 );
+ getMavenJarPluginBasicOption( project, "archive//manifest//mainClass", null ), 5 );
writer.endElement(); // attribute
writer.endElement(); // manifest
}
@@ -331,7 +583,7 @@
}
/**
- * Convenience method to write XML ear task
+ * Convenience method to write XML Ant ear task
*
* @param writer not null
* @param project not null
@@ -345,30 +597,30 @@
writer.startElement( "ear" );
writer.addAttribute( "destfile", "${maven.build.dir}/${maven.build.finalName}.ear" );
addWrapAttribute( writer, "ear", "basedir", "${maven.build.dir}/${maven.build.finalName}", 3 );
- addWrapAttribute( writer, "ear", "compress", getMavenEarPluginConfiguration( project, "archive//compress",
- "true" ), 3 );
- addWrapAttribute( writer, "ear", "includes ", getMavenEarPluginConfiguration( project, "includes", null ), 3 );
- addWrapAttribute( writer, "ear", "excludes", getMavenEarPluginConfiguration( project, "excludes", null ), 3 );
- if ( getMavenEarPluginConfiguration( project, "applicationXml", null ) != null )
+ addWrapAttribute( writer, "ear", "compress",
+ getMavenEarPluginBasicOption( project, "archive//compress", "true" ), 3 );
+ addWrapAttribute( writer, "ear", "includes ", getMavenEarPluginBasicOption( project, "includes", null ), 3 );
+ addWrapAttribute( writer, "ear", "excludes", getMavenEarPluginBasicOption( project, "excludes", null ), 3 );
+ if ( getMavenEarPluginBasicOption( project, "applicationXml", null ) != null )
{
- addWrapAttribute( writer, "ear", "appxml",
- getMavenEarPluginConfiguration( project, "applicationXml", null ), 3 );
+ addWrapAttribute( writer, "ear", "appxml", getMavenEarPluginBasicOption( project, "applicationXml", null ),
+ 3 );
}
else
{
// Generated appxml
addWrapAttribute( writer, "ear", "appxml", "${maven.build.dir}/application.xml", 3 );
}
- if ( getMavenEarPluginConfiguration( project, "manifestFile", null ) != null )
+ if ( getMavenEarPluginBasicOption( project, "manifestFile", null ) != null )
{
- addWrapAttribute( writer, "ear", "manifest",
- getMavenEarPluginConfiguration( project, "manifestFile", null ), 3 );
+ addWrapAttribute( writer, "ear", "manifest", getMavenEarPluginBasicOption( project, "manifestFile", null ),
+ 3 );
}
writer.endElement(); // ear
}
/**
- * Convenience method to write XML war task
+ * Convenience method to write XML Ant war task
*
* @param writer not null
* @param project not null
@@ -383,21 +635,21 @@
writer.startElement( "war" );
writer.addAttribute( "destfile", "${maven.build.dir}/${maven.build.finalName}.war" );
addWrapAttribute( writer, "war", "basedir", "${maven.build.outputDir}", 3 );
- addWrapAttribute( writer, "war", "compress", getMavenWarPluginConfiguration( project, "archive//compress",
- "true" ), 3 );
- if ( getMavenWarPluginConfiguration( project, "webXml", null ) != null )
+ addWrapAttribute( writer, "war", "compress",
+ getMavenWarPluginBasicOption( project, "archive//compress", "true" ), 3 );
+ if ( getMavenWarPluginBasicOption( project, "webXml", null ) != null )
{
- addWrapAttribute( writer, "war", "webxml", getMavenWarPluginConfiguration( project, "webXml", null ), 3 );
+ addWrapAttribute( writer, "war", "webxml", getMavenWarPluginBasicOption( project, "webXml", null ), 3 );
}
else
{
// Default
addWrapAttribute( writer, "war", "webxml", "${basedir}/src/main/webapp/WEB-INF/web.xml", 3 );
}
- if ( getMavenWarPluginConfiguration( project, "manifestFile", null ) != null )
+ if ( getMavenWarPluginBasicOption( project, "manifestFile", null ) != null )
{
- addWrapAttribute( writer, "war", "manifest",
- getMavenWarPluginConfiguration( project, "manifestFile", null ), 3 );
+ addWrapAttribute( writer, "war", "manifest", getMavenWarPluginBasicOption( project, "manifestFile", null ),
+ 3 );
}
writer.startElement( "lib" );
writer.addAttribute( "dir", "${maven.build.dir}/${maven.build.finalName}/WEB-INF/lib" );
@@ -482,64 +734,138 @@
}
/**
- * Return the optionName value defined in a project for the "maven-compiler-plugin" plugin.
+ * Return the <code>optionName</code> value defined in a project for the "maven-compiler-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the value for the option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static String getMavenCompilerPluginBasicOption( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginBasicOption( project, "maven-compiler-plugin", optionName, defaultValue );
+ }
+
+ /**
+ * Return the map of <code>optionName</code> value defined in a project for the "maven-compiler-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the map for the option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static Map getMavenCompilerPluginOption( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginOption( project, "maven-compiler-plugin", optionName, defaultValue );
+ }
+
+ /**
+ * Return an array of map of <code>optionName</code> value defined in a project for the "maven-compiler-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the array of option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static Map[] getMavenCompilerPluginOptions( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginOptions( project, "maven-compiler-plugin", optionName, defaultValue );
+ }
+
+ /**
+ * Return the <code>optionName</code> value defined in a project for the "maven-javadoc-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the value for the option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static String getMavenJavadocPluginBasicOption( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginBasicOption( project, "maven-javadoc-plugin", optionName, defaultValue );
+ }
+
+ /**
+ * Return a map of <code>optionName</code> value defined in a project for the "maven-javadoc-plugin" plugin.
*
* @param project not null
- * @param optionName
- * @param defaultValue
- * @return the value for the option name (comma separated value in the case of list) or null if not found
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the map for the option name or the default value. Could be null if not found.
* @throws IOException if any
*/
- public static String getMavenCompilerPluginConfiguration( MavenProject project, String optionName,
- String defaultValue )
+ public static Map getMavenJavadocPluginOption( MavenProject project, String optionName, String defaultValue )
throws IOException
{
- return getMavenPluginConfiguration( project, "maven-compiler-plugin", optionName, defaultValue );
+ return getMavenPluginOption( project, "maven-javadoc-plugin", optionName, defaultValue );
}
/**
- * Return the optionName value defined in a project for the "maven-jar-plugin" plugin.
+ * Return an array of map of <code>optionName</code> value defined in a project for the "maven-javadoc-plugin" plugin.
*
* @param project not null
- * @param optionName
- * @param defaultValue
- * @return the value for the option name (comma separated value in the case of list) or null if not found
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return an array of option name. Could be null if not found.
* @throws IOException if any
*/
- public static String getMavenJarPluginConfiguration( MavenProject project, String optionName, String defaultValue )
+ public static Map[] getMavenJavadocPluginOptions( MavenProject project, String optionName, String defaultValue )
throws IOException
{
- return getMavenPluginConfiguration( project, "maven-jar-plugin", optionName, defaultValue );
+ return getMavenPluginOptions( project, "maven-javadoc-plugin", optionName, defaultValue );
}
/**
- * Return the optionName value defined in a project for the "maven-ear-plugin" plugin.
+ * Return the <code>optionName</code> value defined in a project for the "maven-jar-plugin" plugin.
*
* @param project not null
- * @param optionName
- * @param defaultValue
- * @return the value for the option name (comma separated value in the case of list) or null if not found
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the value for the option name or the default value. Could be null if not found.
* @throws IOException if any
*/
- public static String getMavenEarPluginConfiguration( MavenProject project, String optionName, String defaultValue )
+ public static String getMavenJarPluginBasicOption( MavenProject project, String optionName, String defaultValue )
throws IOException
{
- return getMavenPluginConfiguration( project, "maven-ear-plugin", optionName, defaultValue );
+ return getMavenPluginBasicOption( project, "maven-jar-plugin", optionName, defaultValue );
}
/**
- * Return the optionName value defined in a project for the "maven-war-plugin" plugin.
+ * Return the <code>optionName</code> value defined in a project for the "maven-ear-plugin" plugin.
*
* @param project not null
- * @param optionName
- * @param defaultValue
- * @return the value for the option name (comma separated value in the case of list) or null if not found
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the value for the option name or the default value. Could be null if not found.
* @throws IOException if any
*/
- public static String getMavenWarPluginConfiguration( MavenProject project, String optionName, String defaultValue )
+ public static String getMavenEarPluginBasicOption( MavenProject project, String optionName, String defaultValue )
throws IOException
{
- return getMavenPluginConfiguration( project, "maven-war-plugin", optionName, defaultValue );
+ return getMavenPluginBasicOption( project, "maven-ear-plugin", optionName, defaultValue );
+ }
+
+ /**
+ * Return the <code>optionName</code> value defined in a project for the "maven-war-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the value for the option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static String getMavenWarPluginBasicOption( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginBasicOption( project, "maven-war-plugin", optionName, defaultValue );
}
// ----------------------------------------------------------------------
@@ -547,61 +873,323 @@
// ----------------------------------------------------------------------
/**
- * Return the optionName value defined in a project for a given artifactId plugin.
+ * Return the value for the option <code>optionName</code> defined in a project with the given
+ * <code>artifactId</code> plugin.
+ * <br/>
+ * Example:
+ * <table>
+ * <tr>
+ * <td>Configuration</td>
+ * <td>Result</td>
+ * </tr>
+ * <tr>
+ * <td><pre><option>value</option></pre></td>
+ * <td><pre>value</pre></td>
+ * </tr>
+ * </table>
*
* @param project not null
- * @param pluginArtifact not null
- * @param optionName an Xpath expression from the plugin <code><configuration/></code>
- * @param defaultValue
- * @return the value for the option name (comma separated value in the case of list) or null if not found
+ * @param pluginArtifactId not null
+ * @param optionName an <code>Xpath</code> expression from the plugin <code><configuration/></code>
+ * @param defaultValue could be null
+ * @return the value for the option name or null if not found
* @throws IOException if any
*/
- private static String getMavenPluginConfiguration( MavenProject project, String pluginArtifact, String optionName,
- String defaultValue )
+ private static String getMavenPluginBasicOption( MavenProject project, String pluginArtifactId, String optionName,
+ String defaultValue )
throws IOException
{
+ return (String) getMavenPluginConfigurationsImpl( project, pluginArtifactId, optionName, defaultValue )
+ .get( optionName );
+ }
+
+ /**
+ * Return a Map for the option <code>optionName</code> defined in a project with the given
+ * <code>artifactId</code> plugin.
+ * <br/>
+ * Example:
+ * <table>
+ * <tr>
+ * <td>Configuration</td>
+ * <td>Result</td>
+ * </tr>
+ * <tr>
+ * <td><pre>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * </pre></td>
+ * <td><pre>{param1=value1, param2=value2}<pre></td>
+ * </tr>
+ * </table>
+ *
+ * @param project not null
+ * @param pluginArtifactId not null
+ * @param optionName an <code>Xpath</code> expression from the plugin <code><configuration/></code>
+ * @param defaultValue could be null
+ * @return the value for the option name or null if not found
+ * @throws IOException if any
+ */
+ private static Map getMavenPluginOption( MavenProject project, String pluginArtifactId, String optionName,
+ String defaultValue )
+ throws IOException
+ {
+ return (Map) getMavenPluginConfigurationsImpl( project, pluginArtifactId, optionName, defaultValue )
+ .get( optionName );
+ }
+
+ /**
+ * Return an array of Map for the option <code>optionName</code> defined in a project with the given
+ * <code>artifactId</code> plugin.
+ * <br/>
+ * Example:
+ * <table>
+ * <tr>
+ * <td>Configuration</td>
+ * <td>Result</td>
+ * </tr>
+ * <tr>
+ * <td><pre>
+ * <options>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * </options>
+ * </pre></td>
+ * <td><pre>[{option=[{param1=value1, param2=value2}]}, {option=[{param1=value1, param2=value2}]<pre></td>
+ * </tr>
+ * </table>
+ *
+ * @param project not null
+ * @param pluginArtifactId not null
+ * @param optionName an <code>Xpath</code> expression from the plugin <code><configuration/></code>
+ * @param defaultValue could be null
+ * @return the value for the option name or null if not found
+ * @throws IOException if any
+ */
+ private static Map[] getMavenPluginOptions( MavenProject project, String pluginArtifactId, String optionName,
+ String defaultValue )
+ throws IOException
+ {
+ return (Map[]) getMavenPluginConfigurationsImpl( project, pluginArtifactId, optionName, defaultValue )
+ .get( optionName );
+ }
+
+ /**
+ * Return a Map for the option <code>optionName</code> defined in a project with the given
+ * <code>artifactId</code> plugin.
+ * <br/>
+ * Example:
+ * <table>
+ * <tr>
+ * <td>Configuration</td>
+ * <td>Result</td>
+ * </tr>
+ * <tr>
+ * <td><pre><option>value</option></pre></td>
+ * <td><pre>{option=value}</pre></td>
+ * </tr>
+ * <tr>
+ * <td><pre>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * </pre></td>
+ * <td><pre>{option={param1=value1, param2=value2}}<pre></td>
+ * </tr>
+ * <tr>
+ * <td><pre>
+ * <options>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * </options>
+ * </pre></td>
+ * <td><pre>{options=[{option=[{param1=value1, param2=value2}]}, {option=[{param1=value1, param2=value2}]}]<pre></td>
+ * </tr>
+ * </table>
+ *
+ * @param project not null
+ * @param pluginArtifactId not null
+ * @param optionName an <code>Xpath</code> expression from the plugin <code><configuration/></code>
+ * @param defaultValue could be null
+ * @return a map with the options found
+ * @throws IOException if any
+ */
+ private static Map getMavenPluginConfigurationsImpl( MavenProject project, String pluginArtifactId,
+ String optionName, String defaultValue )
+ throws IOException
+ {
+ List plugins = new ArrayList();
+ for ( Iterator it = project.getModel().getReporting().getPlugins().iterator(); it.hasNext(); )
+ {
+ plugins.add( it.next() );
+ }
for ( Iterator it = project.getModel().getBuild().getPlugins().iterator(); it.hasNext(); )
{
- Plugin plugin = (Plugin) it.next();
+ plugins.add( it.next() );
+ }
+
+ for ( Iterator it = plugins.iterator(); it.hasNext(); )
+ {
+ Object next = it.next();
- if ( ( plugin.getGroupId().equals( "org.apache.maven.plugins" ) )
- && ( plugin.getArtifactId().equals( pluginArtifact ) ) )
+ Xpp3Dom pluginConf = null;
+
+ if ( next instanceof Plugin )
{
- Xpp3Dom pluginConf = (Xpp3Dom) plugin.getConfiguration();
+ Plugin plugin = (Plugin) next;
- if ( pluginConf != null )
+ // using out-of-box Maven plugins
+ if ( !( ( plugin.getGroupId().equals( "org.apache.maven.plugins" ) ) && ( plugin.getArtifactId()
+ .equals( pluginArtifactId ) ) ) )
{
- StringBuffer sb = new StringBuffer();
- try
- {
- Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
- .parse( new StringInputStream( pluginConf.toString() ) );
+ continue;
+ }
+
+ pluginConf = (Xpp3Dom) plugin.getConfiguration();
+ }
+
+ if ( next instanceof ReportPlugin )
+ {
+ ReportPlugin reportPlugin = (ReportPlugin) next;
+
+ // using out-of-box Maven plugins
+ if ( !( ( reportPlugin.getGroupId().equals( "org.apache.maven.plugins" ) ) && ( reportPlugin
+ .getArtifactId().equals( pluginArtifactId ) ) ) )
+ {
+ continue;
+ }
+
+ pluginConf = (Xpp3Dom) reportPlugin.getConfiguration();
+ }
+
+ if ( pluginConf == null )
+ {
+ continue;
+ }
+
+ try
+ {
+ Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
+ .parse( new StringInputStream( pluginConf.toString() ) );
- XObject obj = XPathAPI.eval( doc, "//configuration//" + optionName );
+ XObject obj = XPathAPI.eval( doc, "//configuration/" + optionName );
- if ( StringUtils.isNotEmpty( obj.toString() ) )
+ NodeList nodeList = obj.nodelist();
+ if ( isList( nodeList.item( 0 ) ) )
+ {
+ /*
+ * <optionNames>
+ * <optionName>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </optionName>
+ * </optionNames>
+ */
+ Map options = new HashMap();
+
+ List optionNames = new ArrayList();
+ NodeList childs = nodeList.item( 0 ).getChildNodes();
+ for ( int i = 0; i < childs.getLength(); i++ )
+ {
+ if ( childs.item( i ).getNodeType() == Node.ELEMENT_NODE )
{
- StringTokenizer token = new StringTokenizer( obj.toString(), "\n " );
- while ( token.hasMoreTokens() )
+ Map option = new HashMap();
+
+ obj = XPathAPI.eval( doc, "//configuration/" + childs.item( i ).getNodeName() );
+
+ if ( StringUtils.isNotEmpty( obj.toString() ) )
{
- sb.append( token.nextToken().trim() );
- if ( token.hasMoreElements() )
+ Map properties = new HashMap();
+ NodeList childs2 = childs.item( i ).getChildNodes();
+ if ( childs2.getLength() > 0 )
{
- sb.append( "," );
+ for ( int j = 0; j < childs2.getLength(); j++ )
+ {
+ if ( childs2.item( j ).getNodeType() == Node.ELEMENT_NODE )
+ {
+ properties.put( childs2.item( j ).getNodeName(), childs2.item( j )
+ .getFirstChild().getNodeValue() );
+ }
+ }
+ option.put( childs.item( i ).getNodeName(), properties );
}
}
- return sb.toString();
+ else
+ {
+ option.put( childs.item( i ).getNodeName(), childs.item( i ).getFirstChild()
+ .getNodeValue() );
+ }
+
+ optionNames.add( option );
}
}
- catch ( Exception e )
+
+ options.put( optionName, optionNames.toArray( new Map[0] ) );
+
+ return options;
+ }
+
+ /*
+ * <optionName>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </optionName>
+ */
+ if ( StringUtils.isNotEmpty( obj.toString() ) )
+ {
+ Map option = new HashMap();
+
+ NodeList childs = nodeList.item( 0 ).getChildNodes();
+ if ( childs.getLength() > 1 )
{
- throw new IOException( "Exception occured" + e.getMessage() );
+ Map parameters = new HashMap();
+
+ for ( int i = 0; i < childs.getLength(); i++ )
+ {
+ if ( childs.item( i ).getNodeType() == Node.ELEMENT_NODE )
+ {
+ parameters.put( childs.item( i ).getNodeName(), childs.item( i ).getFirstChild()
+ .getNodeValue() );
+ }
+ }
+
+ option.put( optionName, parameters );
}
+ else
+ {
+ /*
+ * <optionName>value1</optionName>
+ */
+ option.put( optionName, obj.toString() );
+ }
+
+ return option;
}
}
+ catch ( Exception e )
+ {
+ throw new IOException( "Exception occured: " + e.getMessage() );
+ }
}
- return defaultValue;
+ Map properties = new HashMap();
+ properties.put( optionName, defaultValue );
+
+ return properties;
}
/**
@@ -634,5 +1222,51 @@
}
}
}
+ }
+
+ /**
+ * Check if a given <code>node</code> is a list of nodes or not.
+ * <br/>
+ * For instance, the node <code>options</code> is a list of <code>option</code> in the following case:
+ *<pre>
+ * <options>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * <option>
+ * <param1>value1</param1>
+ * <param2>value2</param2>
+ * </option>
+ * </options>
+ * </pre>
+ *
+ * @param node a given node
+ * @return true if the node is a list, false otherwise.
+ */
+ private static boolean isList( Node node )
+ {
+ if ( node == null )
+ {
+ return false;
+ }
+
+ NodeList childs = node.getChildNodes();
+
+ boolean isList = false;
+ String lastNodeName = null;
+ for ( int i = 0; i < childs.getLength(); i++ )
+ {
+ if ( childs.item( i ).getNodeType() == Node.ELEMENT_NODE )
+ {
+ if ( i != 0 )
+ {
+ isList = isList || ( childs.item( i ).getNodeName().equals( lastNodeName ) );
+ }
+ lastNodeName = childs.item( i ).getNodeName();
+ }
+ }
+
+ return isList;
}
}
Modified: maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java (original)
+++ maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntMojo.java Thu Feb 22 04:29:45 2007
@@ -19,14 +19,16 @@
* under the License.
*/
+import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
-import java.io.File;
import java.io.IOException;
+import java.util.List;
/**
* Generate Ant build files.
@@ -49,7 +51,21 @@
private MavenProject project;
/**
- * The location of the local repository.
+ * Used for resolving artifacts
+ *
+ * @component
+ */
+ private ArtifactResolver resolver;
+
+ /**
+ * Factory for creating artifact objects
+ *
+ * @component
+ */
+ private ArtifactFactory factory;
+
+ /**
+ * The local repository where the artifacts are located
*
* @parameter expression="${localRepository}"
* @required
@@ -57,6 +73,13 @@
private ArtifactRepository localRepository;
/**
+ * The remote repositories where artifacts are located
+ *
+ * @parameter expression="${project.remoteArtifactRepositories}"
+ */
+ private List remoteRepositories;
+
+ /**
* The current user system settings for use in Maven.
*
* @parameter expression="${settings}"
@@ -78,8 +101,11 @@
public void execute()
throws MojoExecutionException
{
- AntBuildWriter antBuildWriter = new AntBuildWriter( project, new File( localRepository.getBasedir() ),
- settings, overwrite );
+ ArtifactResolverWrapper artifactResolverWrapper = ArtifactResolverWrapper.getInstance( resolver, factory,
+ localRepository,
+ remoteRepositories );
+
+ AntBuildWriter antBuildWriter = new AntBuildWriter( project, artifactResolverWrapper, settings, overwrite );
try
{
Added: maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/ArtifactResolverWrapper.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/ArtifactResolverWrapper.java?view=auto&rev=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/ArtifactResolverWrapper.java (added)
+++ maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/ArtifactResolverWrapper.java Thu Feb 22 04:29:45 2007
@@ -0,0 +1,157 @@
+package org.apache.maven.plugin.ant;
+
+/*
+ * 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.IOException;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+
+/**
+ * Wrapper object to resolve artifact.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class ArtifactResolverWrapper
+{
+ /**
+ * Used for resolving artifacts
+ */
+ private ArtifactResolver resolver;
+
+ /**
+ * Factory for creating artifact objects
+ */
+ private ArtifactFactory factory;
+
+ /**
+ * The local repository where the artifacts are located
+ */
+ private ArtifactRepository localRepository;
+
+ /**
+ * The remote repositories where artifacts are located
+ */
+ private List remoteRepositories;
+
+ /**
+ * @param resolver
+ * @param factory
+ * @param localRepository
+ * @param remoteRepositories
+ */
+ private ArtifactResolverWrapper( ArtifactResolver resolver, ArtifactFactory factory,
+ ArtifactRepository localRepository, List remoteRepositories )
+ {
+ this.resolver = resolver;
+ this.factory = factory;
+ this.localRepository = localRepository;
+ this.remoteRepositories = remoteRepositories;
+ }
+
+ /**
+ * @param resolver
+ * @param factory
+ * @param localRepository
+ * @param remoteRepositories
+ * @return an instance of ArtifactResolverWrapper
+ */
+ public static ArtifactResolverWrapper getInstance( ArtifactResolver resolver, ArtifactFactory factory,
+ ArtifactRepository localRepository, List remoteRepositories )
+ {
+ return new ArtifactResolverWrapper( resolver, factory, localRepository, remoteRepositories );
+ }
+
+ protected ArtifactFactory getFactory()
+ {
+ return factory;
+ }
+
+ protected void setFactory( ArtifactFactory factory )
+ {
+ this.factory = factory;
+ }
+
+ protected ArtifactRepository getLocalRepository()
+ {
+ return localRepository;
+ }
+
+ protected void setLocalRepository( ArtifactRepository localRepository )
+ {
+ this.localRepository = localRepository;
+ }
+
+ protected List getRemoteRepositories()
+ {
+ return remoteRepositories;
+ }
+
+ protected void setRemoteRepositories( List remoteRepositories )
+ {
+ this.remoteRepositories = remoteRepositories;
+ }
+
+ protected ArtifactResolver getResolver()
+ {
+ return resolver;
+ }
+
+ protected void setResolver( ArtifactResolver resolver )
+ {
+ this.resolver = resolver;
+ }
+
+ /**
+ * Return the artifact path in the local repository for an artifact defined by its <code>groupId</code>,
+ * its <code>artifactId</code> and its <code>version</code>.
+ *
+ * @param groupId
+ * @param artifactId
+ * @param version
+ * @return the locale artifact path
+ * @throws IOException if any
+ */
+ public String getArtifactAbsolutePath( String groupId, String artifactId, String version )
+ throws IOException
+ {
+ Artifact artifact = factory.createArtifact( groupId, artifactId, version, "compile", "jar" );
+ try
+ {
+ resolver.resolve( artifact, remoteRepositories, localRepository );
+
+ return artifact.getFile().getAbsolutePath();
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new IOException( "Unable to resolve artifact: " + groupId + ":" + artifactId + ":" + version );
+ }
+ catch ( ArtifactNotFoundException e )
+ {
+ throw new IOException( "Unable to find artifact: " + groupId + ":" + artifactId + ":" + version );
+ }
+ }
+}
Propchange: maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/ArtifactResolverWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/ArtifactResolverWrapper.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/plugins/trunk/maven-ant-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/site/fml/faq.fml?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/site/fml/faq.fml (original)
+++ maven/plugins/trunk/maven-ant-plugin/src/site/fml/faq.fml Thu Feb 22 04:29:45 2007
@@ -26,5 +26,13 @@
</p>
</answer>
</faq>
+ <faq id="What are the generated key tasks">
+ <question>What are the generated key tasks?</question>
+ <answer>
+ <p>
+ The key tasks are: clean, compile, compile-tests, test, javadoc, package.
+ </p>
+ </answer>
+ </faq>
</part>
</faqs>
Modified: maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java (original)
+++ maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java Thu Feb 22 04:29:45 2007
@@ -58,7 +58,7 @@
{
StringWriter s = new StringWriter();
XMLWriter writer = new PrettyPrintXMLWriter( s );
- AntBuildWriterUtil.writeComment( writer, "This is a short text");
+ AntBuildWriterUtil.writeComment( writer, "This is a short text" );
StringBuffer sb = new StringBuffer();
sb.append( "<!-- This is a short text -->" ).append( '\n' );
assertTrue( s.toString().equals( sb.toString() ) );
@@ -71,9 +71,9 @@
{
StringWriter s = new StringWriter();
XMLWriter writer = new PrettyPrintXMLWriter( s );
- AntBuildWriterUtil.writeComment( writer, "Maven is a software project management and comprehension tool. " +
- "Based on the concept of a project object model (POM), Maven can manage a project's build, reporting " +
- "and documentation from a central piece of information." );
+ AntBuildWriterUtil.writeComment( writer, "Maven is a software project management and comprehension tool. "
+ + "Based on the concept of a project object model (POM), Maven can manage a project's build, reporting "
+ + "and documentation from a central piece of information." );
StringBuffer sb = new StringBuffer();
sb.append( "<!-- Maven is a software project management and comprehension tool. Based -->" ).append( '\n' );
sb.append( "<!-- on the concept of a project object model (POM), Maven can manage a -->" ).append( '\n' );
@@ -101,9 +101,10 @@
MavenProject project = maven.readProjectWithDependencies( testPom );
- assertEquals( AntBuildWriterUtil.getMavenCompilerPluginConfiguration( project, "debug", null ), "true" );
- assertEquals( AntBuildWriterUtil.getMavenCompilerPluginConfiguration( project, "includes", null ),
- "**/*.java,**/*.jad" );
+ assertEquals( AntBuildWriterUtil.getMavenCompilerPluginBasicOption( project, "debug", null ), "true" );
+
+ assertNotNull( AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "includes", null ) );
+ assertEquals( AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "includes", null ).length, 2 );
maven.stop();
}
@@ -127,9 +128,39 @@
MavenProject project = maven.readProjectWithDependencies( testPom );
- assertEquals( AntBuildWriterUtil.getMavenWarPluginConfiguration( project, "warName", null ), "mywebapp" );
- assertTrue( AntBuildWriterUtil.getMavenWarPluginConfiguration( project, "webXml", null )
+ assertEquals( AntBuildWriterUtil.getMavenWarPluginBasicOption( project, "warName", null ), "mywebapp" );
+ assertTrue( AntBuildWriterUtil.getMavenWarPluginBasicOption( project, "webXml", null )
.endsWith( "/src/main/webapp/WEB-INF/web.xml" ) );
+
+ maven.stop();
+ }
+
+ /**
+ * Test method for 'org.apache.maven.plugin.ant.AntBuildWriterUtil.getMavenJavadocPluginConfiguration(MavenProject, String, String)'
+ *
+ * @throws Exception
+ */
+ public void testGetMavenJavadocPluginConfiguration()
+ throws Exception
+ {
+ File testPom = new File( getBasedir(), "src/test/resources/unit/ant-javadoc-test/pom.xml" );
+
+ MavenEmbedder maven = new MavenEmbedder();
+ maven.setClassLoader( Thread.currentThread().getContextClassLoader() );
+ maven.setLogger( new MavenEmbedderConsoleLogger() );
+ maven.setLocalRepositoryDirectory( getTestFile( "target/local-repo" ) );
+ maven.setOffline( true );
+ maven.start();
+
+ MavenProject project = maven.readProjectWithDependencies( testPom );
+
+ assertEquals( AntBuildWriterUtil.getMavenJavadocPluginBasicOption( project, "doclet", null ), "gr.spinellis.umlgraph.doclet.UmlGraphDoc" );
+
+ assertNotNull( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "links", null ) );
+ assertEquals( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "links", null ).length, 2 );
+
+ assertNotNull( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "docletArtifacts", null ) );
+ assertEquals( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "docletArtifacts", null ).length, 2 );
maven.stop();
}
Modified: maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntMojoTest.java?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntMojoTest.java (original)
+++ maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/AntMojoTest.java Thu Feb 22 04:29:45 2007
@@ -77,6 +77,17 @@
}
/**
+ * Method to test Project with no dependencies
+ *
+ * @throws Exception
+ */
+ public void testProjectWithJavadoc()
+ throws Exception
+ {
+ invokeAntMojo( "ant-javadoc-test" );
+ }
+
+ /**
* Invoke Ant mojo.
* <br/>
* The Maven test project should be in a directory called <code>testProject</code> in "src/test/resources/unit/" directory.
Modified: maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java?view=diff&rev=510478&r1=510477&r2=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java Thu Feb 22 04:29:45 2007
@@ -31,6 +31,7 @@
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.model.Build;
import org.apache.maven.model.Model;
+import org.apache.maven.model.Reporting;
import org.apache.maven.model.Repository;
import org.apache.maven.model.Resource;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -91,6 +92,8 @@
build.setTestOutputDirectory( getBasedir().getAbsolutePath() + "/target/test-classes" );
setBuild( build );
+
+ getModel().setReporting( new Reporting() );
}
/**
@@ -179,6 +182,14 @@
public Properties getProperties()
{
return getModel().getProperties();
+ }
+
+ /**
+ * @see org.apache.maven.project.MavenProject#getReporting()
+ */
+ public Reporting getReporting()
+ {
+ return getModel().getReporting();
}
/**
Added: maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/JavadocTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/JavadocTestMavenProjectStub.java?view=auto&rev=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/JavadocTestMavenProjectStub.java (added)
+++ maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/JavadocTestMavenProjectStub.java Thu Feb 22 04:29:45 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.plugin.ant.stubs;
+
+/*
+ * 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.
+ */
+
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class JavadocTestMavenProjectStub
+ extends AbstractAntTestMavenProjectStub
+{
+ /**
+ * @see org.apache.maven.plugin.ant.stubs.AbstractAntTestMavenProjectStub#getProjetPath()
+ */
+ public String getProjetPath()
+ {
+ return "ant-javadoc-test";
+ }
+}
Propchange: maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/JavadocTestMavenProjectStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-ant-plugin/src/test/java/org/apache/maven/plugin/ant/stubs/JavadocTestMavenProjectStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/pom.xml?view=auto&rev=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/pom.xml (added)
+++ maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/pom.xml Thu Feb 22 04:29:45 2007
@@ -0,0 +1,119 @@
+<?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
+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.
+-->
+
+<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>
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.unit</groupId>
+ <artifactId>ant-test</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <inceptionYear>2006</inceptionYear>
+ <name>Maven Ant Plugin Test</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <configuration>
+ <project implementation="org.apache.maven.plugin.ant.stubs.JavadocTestMavenProjectStub"/>
+ <settings implementation="org.apache.maven.plugin.ant.stubs.SettingsStub"/>
+ <localRepository>${localRepository}</localRepository>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/j2ee/1.4/docs/api</link>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
+ </links>
+ <doclet>gr.spinellis.umlgraph.doclet.UmlGraphDoc</doclet>
+ <docletArtifact>
+ <groupId>gr.spinellis</groupId>
+ <artifactId>UmlGraph</artifactId>
+ <version>4.5</version>
+ </docletArtifact>
+
+ <docletArtifacts>
+ <docletArtifact>
+ <groupId>gr.spinellis</groupId>
+ <artifactId>UmlGraph</artifactId>
+ <version>4.5</version>
+ </docletArtifact>
+ <docletArtifact>
+ <groupId>gr.spinellis</groupId>
+ <artifactId>UmlGraph</artifactId>
+ <version>4.5</version>
+ </docletArtifact>
+ </docletArtifacts>
+
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/j2ee/1.4/docs/api</link>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
+ </links>
+ <doclet>gr.spinellis.umlgraph.doclet.UmlGraphDoc</doclet>
+ <docletArtifact>
+ <groupId>gr.spinellis</groupId>
+ <artifactId>UmlGraph</artifactId>
+ <version>4.5</version>
+ </docletArtifact>
+
+ <docletArtifacts>
+ <docletArtifact>
+ <groupId>gr.spinellis</groupId>
+ <artifactId>UmlGraph</artifactId>
+ <version>4.5</version>
+ </docletArtifact>
+ <docletArtifact>
+ <groupId>gr.spinellis</groupId>
+ <artifactId>UmlGraph</artifactId>
+ <version>4.5</version>
+ </docletArtifact>
+ </docletArtifacts>
+
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Propchange: maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/App.java?view=auto&rev=510478
==============================================================================
--- maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/App.java (added)
+++ maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/App.java Thu Feb 22 04:29:45 2007
@@ -0,0 +1,32 @@
+package org.apache.maven.plugins.ant.test;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Propchange: maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-ant-plugin/src/test/resources/unit/ant-javadoc-test/src/main/java/org/apache/maven/plugins/ant/test/App.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"