You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2014/04/19 13:31:57 UTC
svn commit: r1588642 - in /maven/plugin-tools/trunk/maven-plugin-plugin/src:
it/mplugin-191/ it/mplugin-191/src/ it/mplugin-191/src/main/
it/mplugin-191/src/main/java/ it/mplugin-191/src/main/java/org/
it/mplugin-191/src/main/java/org/apache/ it/mplugi...
Author: rfscholte
Date: Sat Apr 19 11:31:57 2014
New Revision: 1588642
URL: http://svn.apache.org/r1588642
Log:
[MPLUGIN-191] plugin-info.html is not created
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/invoker.properties
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/pom.xml
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/plugin/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/plugin/it/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/verify.groovy
Modified:
maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/invoker.properties?rev=1588642&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/invoker.properties (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/invoker.properties Sat Apr 19 11:31:57 2014
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals = clean compile plugin:report
Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/pom.xml?rev=1588642&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/pom.xml (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/pom.xml Sat Apr 19 11:31:57 2014
@@ -0,0 +1,67 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.plugin.its</groupId>
+ <artifactId>mplugin-191</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+
+ <description>Verify that plugin-info.html and mojo pages are generated in the correct folder</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>@project.version@</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java?rev=1588642&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/src/main/java/org/apache/maven/plugins/plugin/it/MyMojo.java Sat Apr 19 11:31:57 2014
@@ -0,0 +1,81 @@
+package org.apache.maven.plugins.plugin.it;
+
+/*
+ * 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 org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * Goal which touches a timestamp file.
+ */
+@Mojo(name = "touch", defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
+public class MyMojo
+ extends AbstractMojo
+{
+ /**
+ * Location of the file.
+ */
+ @Parameter(defaultValue = "${project.build.directory}", required = true)
+ private File outputDirectory;
+
+ public void execute()
+ throws MojoExecutionException
+ {
+ File f = outputDirectory;
+
+ if ( !f.exists() )
+ {
+ f.mkdirs();
+ }
+
+ File touch = new File( f, "touch.txt" );
+
+ FileWriter w = null;
+ try
+ {
+ w = new FileWriter( touch );
+
+ w.write( "touch.txt" );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "Error creating file " + touch, e );
+ }
+ finally
+ {
+ if ( w != null )
+ {
+ try
+ {
+ w.close();
+ }
+ catch ( IOException e )
+ {
+ // ignore
+ }
+ }
+ }
+ }
+}
Added: maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/verify.groovy?rev=1588642&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/verify.groovy (added)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-191/verify.groovy Sat Apr 19 11:31:57 2014
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+File pluginInfo = new File( basedir, "target/site/plugin-info.html" );
+assert pluginInfo.isFile()
+
+File touchMojo = new File( basedir, "target/generated-site/xdoc/touch-mojo.xml" );
+assert touchMojo.isFile()
+
+return true;
Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java?rev=1588642&r1=1588641&r2=1588642&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java Sat Apr 19 11:31:57 2014
@@ -71,7 +71,7 @@ public class PluginReport
extends AbstractMavenReport
{
/**
- * Report output directory.
+ * Report output directory for mojo pages.
*/
@Parameter( defaultValue = "${project.build.directory}/generated-site/xdoc" )
private File outputDirectory;
@@ -195,7 +195,8 @@ public class PluginReport
*/
protected String getOutputDirectory()
{
- return outputDirectory.getPath();
+ // PLUGIN-191: output directory of plugin.html, not *-mojo.xml
+ return project.getReporting().getOutputDirectory();
}
/**
@@ -327,7 +328,7 @@ public class PluginReport
{
try
{
- File outputDir = new File( getOutputDirectory() );
+ File outputDir = outputDirectory;
outputDir.mkdirs();
PluginXdocGenerator generator = new PluginXdocGenerator( project, locale );