You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Slawomir Jaranowski (Jira)" <ji...@apache.org> on 2022/10/26 20:32:00 UTC

[jira] [Updated] (MPLUGIN-408) simplification in helpmojo build

     [ https://issues.apache.org/jira/browse/MPLUGIN-408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Slawomir Jaranowski updated MPLUGIN-408:
----------------------------------------
    Issue Type: Improvement  (was: Wish)

> simplification in helpmojo build
> --------------------------------
>
>                 Key: MPLUGIN-408
>                 URL: https://issues.apache.org/jira/browse/MPLUGIN-408
>             Project: Maven Plugin Tools
>          Issue Type: Improvement
>            Reporter: Slawomir Jaranowski
>            Assignee: Slawomir Jaranowski
>            Priority: Major
>             Fix For: 3.7.0
>
>
> h2. Current situation
> - {{plugin:helpmojo}} extends {{AbstractGeneratorMojo}}
> - {{plugin:helpmojo}} is bound to {{generate-sources}} phase
> see https://maven.apache.org/plugin-tools/maven-plugin-plugin/helpmojo-mojo.html
> We have 2 steps for generate a {{HelpMojo}} for a plugin:
> 1. first step in {{plugin:helpmojo}} goal
>  - {{helpmojo}} *builds plugin.xml descriptor* by discovering mojos in project (hoping to find javadoc annotations as it was done in the past), when we use {{@Mojo}} annotations for goals descriptions no mojo are discovered because source generation happens before compilation
>  - try to discover package for {{HelpMojo}}: because descriptor is empty - *empty package* is used for generating source for {{HelpMojo}}
> 2. next step in {{plugin:descriptor}} goal, bound to {{process-classes}} phase https://maven.apache.org/plugin-tools/maven-plugin-plugin/descriptor-mojo.html
>  - once again *build plugin descriptors* by discovering mojos in project, but this time
>  - now we can have mojo so we can calculate package name
>  - empty package name of {{HelpMojo}} is rewritten in generated source code
>  - using ASM, package in class of {{HelpMojo}} is changed
>  - source code and compiled class are moved to correct directory
> h2. Simplification proposition
>  - use {{groupId.artifactId}} as java package of {{HelpMojo}} directly in {{plugin:helpmojo}} when generating source code
>  - cleanup/simplify code (remove the {{plugin:descriptor}} package discovery and move)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)