[ https://issues.apache.org/jira/browse/MPLUGIN-408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17572554#comment-17572554 ]
ASF GitHub Bot commented on MPLUGIN-408: ---------------------------------------- slawekjaranowski opened a new pull request, #129: URL: https://github.com/apache/maven-plugin-tools/pull/129 - use groupId + artifactId for calculating package name - discover mojos only ones by descriptor mojo - simplify in AbstractGeneratorMojo - remove unneeded code > simplification in helpmojo build > -------------------------------- > > Key: MPLUGIN-408 > URL: https://issues.apache.org/jira/browse/MPLUGIN-408 > Project: Maven Plugin Tools > Issue Type: Wish > Reporter: Slawomir Jaranowski > Priority: Major > > 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)