Author: gboue Date: Thu Jan 12 00:07:08 2017 New Revision: 1778362 URL: http://svn.apache.org/viewvc?rev=1778362&view=rev Log: [MPLUGIN-314] invalid requirement role generated in plugin.xml [MPLUGIN-320] JavaJavadocMojoDescriptorExtractor fails with Java 8 lambdas.
Updating QDox to 2.0-M5, containing the fixes for both of those issues (see QDOX-13 and QDOX-15). Added: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/ maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/MyMojo.java (with props) maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/plugin-expected.xml (with props) maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/ maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/Exceptions.java (with props) maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/plugin-expected.xml (with props) Modified: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaMojoDescriptorExtractorTest.java maven/plugin-tools/trunk/pom.xml Modified: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaMojoDescriptorExtractorTest.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaMojoDescriptorExtractorTest.java?rev=1778362&r1=1778361&r2=1778362&view=diff ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaMojoDescriptorExtractorTest.java (original) +++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaMojoDescriptorExtractorTest.java Thu Jan 12 00:07:08 2017 @@ -233,4 +233,20 @@ public class JavaMojoDescriptorExtractor assertEquals( 1, results.size() ); } + public void testSingleTypeImportWithFullyQualifiedClassName() + throws Exception + { + List<MojoDescriptor> results = extract( "MPLUGIN-314" ); + + assertEquals( 1, results.size() ); + } + + public void testMethodReferenceInEnumConstructor() + throws Exception + { + List<MojoDescriptor> results = extract( "MPLUGIN-320" ); + + assertNull( results ); + } + } Added: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/MyMojo.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/MyMojo.java?rev=1778362&view=auto ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/MyMojo.java (added) +++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/MyMojo.java Thu Jan 12 00:07:08 2017 @@ -0,0 +1,41 @@ +/* + * 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.artifact.resolver.ArtifactResolver; +import org.apache.maven.plugin.AbstractMojo; + +/** + * Tests that using an import and the same fully qualified class name results in a correct requirement role generated. + * + * @goal test + */ +public class MyMojo + extends AbstractMojo +{ + + /** + * @component + */ + private org.apache.maven.artifact.resolver.ArtifactResolver resolver; + + public void execute() + { + } + +} Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/MyMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/MyMojo.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/plugin-expected.xml URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/plugin-expected.xml?rev=1778362&view=auto ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/plugin-expected.xml (added) +++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/plugin-expected.xml Thu Jan 12 00:07:08 2017 @@ -0,0 +1,56 @@ +<?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. + --> + +<plugin> + <name></name> + <description></description> + <groupId></groupId> + <artifactId></artifactId> + <version></version> + <goalPrefix>test</goalPrefix> + <isolatedRealm>false</isolatedRealm> + <inheritedByDefault>true</inheritedByDefault> + <mojos> + <mojo> + <goal>test</goal> + <description>Tests that using an import and the same fully qualified class name results in a correct requirement role generated.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>MyMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>false</threadSafe> + <parameters/> + <requirements> + <requirement> + <role>org.apache.maven.artifact.resolver.ArtifactResolver</role> + <field-name>resolver</field-name> + </requirement> + </requirements> + </mojo> + </mojos> + <dependencies/> +</plugin> \ No newline at end of file Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/plugin-expected.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-314/plugin-expected.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/Exceptions.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/Exceptions.java?rev=1778362&view=auto ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/Exceptions.java (added) +++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/Exceptions.java Thu Jan 12 00:07:08 2017 @@ -0,0 +1,32 @@ +/* + * 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.util.function.Supplier; + +public enum Exceptions { + NPE(NullPointerException::new), + IAE(IllegalArgumentException::new); + + private final Supplier<? extends Exception> supplier; + + <T extends Exception> Exceptions(Supplier<T> supplier) { + this.supplier = supplier; + } + +} \ No newline at end of file Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/Exceptions.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/Exceptions.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/plugin-expected.xml URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/plugin-expected.xml?rev=1778362&view=auto ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/plugin-expected.xml (added) +++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/plugin-expected.xml Thu Jan 12 00:07:08 2017 @@ -0,0 +1,33 @@ +<?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. + --> + +<plugin> + <name></name> + <description></description> + <groupId></groupId> + <artifactId></artifactId> + <version></version> + <goalPrefix>test</goalPrefix> + <isolatedRealm>false</isolatedRealm> + <inheritedByDefault>true</inheritedByDefault> + <mojos/> + <dependencies/> +</plugin> \ No newline at end of file Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/plugin-expected.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/MPLUGIN-320/plugin-expected.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/plugin-tools/trunk/pom.xml URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/pom.xml?rev=1778362&r1=1778361&r2=1778362&view=diff ============================================================================== --- maven/plugin-tools/trunk/pom.xml (original) +++ maven/plugin-tools/trunk/pom.xml Thu Jan 12 00:07:08 2017 @@ -214,7 +214,7 @@ <dependency> <groupId>com.thoughtworks.qdox</groupId> <artifactId>qdox</artifactId> - <version>2.0-M4</version> + <version>2.0-M5</version> </dependency> <dependency>