Author: rfscholte
Date: Fri Aug 12 20:18:48 2016
New Revision: 1756221
URL: http://svn.apache.org/viewvc?rev=1756221&view=rev
Log:
[MPLUGIN-299] Help mojo cannot display goal details
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/invoker.properties
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/java/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/java/test/
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/java/test/MyMojo.java
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/test.properties
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/help-class-source.vm
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/invoker.properties?rev=1756221&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/invoker.properties
(added)
+++
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/invoker.properties
Fri Aug 12 20:18:48 2016
@@ -0,0 +1,20 @@
+# 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.maven.version = 3.0+
+invoker.goals.1 = clean install -DskipTests
+invoker.goals.2 = --log-file help.log
org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml?rev=1756221&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml
(added)
+++
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/pom.xml
Fri Aug 12 20:18:48 2016
@@ -0,0 +1,87 @@
+<?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.its.plugin</groupId>
+ <artifactId>help</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+
+ <description>
+ Tests generation and compilation of the help mojo.
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>@project.version@</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <id>default-descriptor</id>
+ <phase>process-classes</phase>
+ </execution>
+ <execution>
+ <id>help-goal</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/java/test/MyMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/java/test/MyMojo.java?rev=1756221&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/java/test/MyMojo.java
(added)
+++
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/src/main/java/test/MyMojo.java
Fri Aug 12 20:18:48 2016
@@ -0,0 +1,37 @@
+package 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.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+@Mojo( name= "test" )
+public class MyMojo
+ extends AbstractMojo
+{
+ @Parameter
+ private String empyAnnotatedParameter;
+
+ public void execute()
+ {
+ }
+
+}
Added:
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/test.properties
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/test.properties?rev=1756221&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/test.properties
(added)
+++
maven/plugin-tools/trunk/maven-plugin-plugin/src/it/mplugin-299_no-configuration/test.properties
Fri Aug 12 20:18:48 2016
@@ -0,0 +1,19 @@
+# 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.
+
+detail = true
+goal = test
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/help-class-source.vm
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/help-class-source.vm?rev=1756221&r1=1756220&r2=1756221&view=diff
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/help-class-source.vm
(original)
+++
maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/help-class-source.vm
Fri Aug 12 20:18:48 2016
@@ -321,7 +321,11 @@ public class HelpMojo
String parameterName = getValue( parameter, "name" );
String parameterDescription = getValue( parameter, "description" );
- Element fieldConfigurationElement = (Element) findSingleChild(
configurationElement, parameterName );
+ Element fieldConfigurationElement = null;
+ if ( configurationElement != null )
+ {
+ fieldConfigurationElement = (Element) findSingleChild(
configurationElement, parameterName );
+ }
String parameterDefaultValue = "";
if ( fieldConfigurationElement != null &&
fieldConfigurationElement.hasAttribute( "default-value" ) )