Uploaded image for project: 'Maven Plugin Tools'
  1. Maven Plugin Tools
  2. MPLUGIN-408

simplification in helpmojo build

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.7.0
    • None
    • None

    Description

      Current situation

      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

      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)

      Attachments

        Issue Links

          Activity

            People

              sjaranowski Slawomir Jaranowski
              sjaranowski Slawomir Jaranowski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: