Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#403 Extractor fails with maven > 3.9.0 #404

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions kotlin-maven-plugin-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-descriptor</artifactId>
</exclusion>
<!-- provided by maven.plugin-tools -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<!-- provided by maven.plugin-tools -->
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
14 changes: 5 additions & 9 deletions kotlin-maven-plugin-tools/src/it/basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
<kotlin.version>1.2.41</kotlin.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.version>3.5.3</maven.version>
<maven.version>3.9.5</maven.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven-plugin-tools.version>3.7.1</maven-plugin-tools.version>
<maven-plugin-plugin.version>3.10.2</maven-plugin-plugin.version>
</properties>

<dependencies>
Expand All @@ -59,7 +61,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5.1</version>
<version>${maven-plugin-tools.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -101,7 +103,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5.1</version>
<version>${maven-plugin-plugin.version}</version>
<configuration>
<extractors>
<extractor>kotlin</extractor>
Expand All @@ -119,12 +121,6 @@
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
107 changes: 57 additions & 50 deletions kotlin-maven-plugin-tools/src/it/basic/postbuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (!file.isFile()) {
def expected = '''
<?xml version="1.0" encoding="UTF-8"?>

<!-- Generated by maven-plugin-tools 3.5 -->
<!-- Generated by maven-plugin-tools 3.10-->

<plugin>
<name>example-maven-plugin</name>
Expand All @@ -36,6 +36,7 @@ def expected = '''
<goalPrefix>example</goalPrefix>
<isolatedRealm>false</isolatedRealm>
<inheritedByDefault>true</inheritedByDefault>
<requiredMavenVersion>3.9.5</requiredMavenVersion>
<mojos>
<mojo>
<goal>example</goal>
Expand Down Expand Up @@ -85,8 +86,8 @@ def expected = '''
</mojo>
<mojo>
<goal>help</goal>
<description>Display help information on example-maven-plugin.&lt;br&gt;
Call &lt;code&gt;mvn example:help -Ddetail=true -Dgoal=&amp;lt;goal-name&amp;gt;&lt;/code&gt; to display parameter details.</description>
<description>Display help information on example-maven-plugin.
Call mvn example:help -Ddetail=true -Dgoal=&lt;goal-name&gt; to display parameter details.</description>
<requiresDirectInvocation>false</requiresDirectInvocation>
<requiresProject>false</requiresProject>
<requiresReports>false</requiresReports>
Expand All @@ -104,7 +105,7 @@ Call &lt;code&gt;mvn example:help -Ddetail=true -Dgoal=&amp;lt;goal-name&amp;gt;
<type>boolean</type>
<required>false</required>
<editable>true</editable>
<description>If &lt;code&gt;true&lt;/code&gt;, display all settable properties for each goal.</description>
<description>If true, display all settable properties for each goal.</description>
</parameter>
<parameter>
<name>goal</name>
Expand Down Expand Up @@ -141,139 +142,127 @@ Call &lt;code&gt;mvn example:help -Ddetail=true -Dgoal=&amp;lt;goal-name&amp;gt;
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings-builder</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<type>jar</type>
<version>1.24</version>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-sec-dispatcher</artifactId>
<type>jar</type>
<version>1.4</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-cipher</artifactId>
<type>jar</type>
<version>1.4</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-builder-support</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
<type>jar</type>
<version>1.1.1</version>
<version>1.9.16</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-named-locks</artifactId>
<type>jar</type>
<version>1.9.16</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<type>jar</type>
<version>1.1.1</version>
<version>1.9.16</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-spi</artifactId>
<type>jar</type>
<version>1.1.1</version>
<version>1.9.16</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<type>jar</type>
<version>1.1.1</version>
<version>1.9.16</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<type>jar</type>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<type>jar</type>
<version>2.5</version>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<type>jar</type>
<version>0.3.3</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<type>jar</type>
<version>1.0</version>
<version>0.3.5</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<artifactId>javax.annotation-api</artifactId>
<type>jar</type>
<version>1.0</version>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
<type>jar</type>
<version>0.3.3</version>
<version>0.3.5</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<type>jar</type>
<version>4.0</version>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
Expand All @@ -285,7 +274,13 @@ Call &lt;code&gt;mvn example:help -Ddetail=true -Dgoal=&amp;lt;goal-name&amp;gt;
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<type>jar</type>
<version>20.0</version>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>failureaccess</artifactId>
<type>jar</type>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
Expand All @@ -297,31 +292,43 @@ Call &lt;code&gt;mvn example:help -Ddetail=true -Dgoal=&amp;lt;goal-name&amp;gt;
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<type>jar</type>
<version>3.1.0</version>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-classworlds</artifactId>
<type>jar</type>
<version>2.5.2</version>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<type>jar</type>
<version>1.26</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<type>jar</type>
<version>1.7.1</version>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<type>jar</type>
<version>3.5</version>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<type>jar</type>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<type>jar</type>
<version>3.5.3</version>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.apache.maven.plugin.descriptor.Requirement
import org.apache.maven.repository.RepositorySystem
import org.apache.maven.tools.plugin.ExtendedMojoDescriptor
import org.apache.maven.tools.plugin.PluginToolsRequest
import org.apache.maven.tools.plugin.extractor.GroupKey
import org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ComponentAnnotationContent
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ExecuteAnnotationContent
Expand Down Expand Up @@ -67,6 +68,12 @@ class KotlinMojoDescriptorExtractor @Inject constructor(
return mojoAnnotatedClasses.toMojoDescriptors(request.pluginDescriptor)
}

override fun getName(): String = "kotlin"

override fun isDeprecated(): Boolean = false

override fun getGroupKey(): GroupKey = GroupKey("kotlin", 100)

/**
* Scan sources to get @since and @deprecated and description of classes and properties.
*/
Expand Down
Loading