Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-3072

Add workaround for maven plugin-plugin bug

    XMLWordPrintableJSON

Details

    Description

      The maven-plugin-plugin is used in several projects to help build maven plugins. Two of its goals, helpmojo and descriptor, extract info about the plugin from annotations. A recent change deprecated the use of javadoc-style annotations, in favor of Java 5 annotations, and we've changed our maven plugin projects to Java 5 annotation style.

      Unfortunately, this style is broken for these two goals in the maven-plugin-plugin, because the goals end up in many cases (including during release:prepare, and if you use "clean install") being run before the compiler runs. The scan for these Java annotations scans the compiled code (which is not there yet, after, for instance, a clean has been run but before the compiler has run), and doesn't find any.

      Two Jira issues (currently unresolved) address this:

      The way the helpmojo works - appears not to necessarily depend on having the annotations at that time. The generated helpmojo class is data driven, and works off of an XML file it finds in META-INF/maven/org.apache.uima/<name-of-plugin>/plugin-help.xml. When the helpmojo is run, it does 2 things: it generates a generic helpmojo java source, and it uses the annotations it finds to generate that datafile (plugin-help.xml). If this is run together with a later run of the "descriptor" goal, then that latter goal regenerates the plugin-help.xml.

      So, things work if you run the helpmojo goal before the compiler step - it generates the helpmojo java source code to be included in the compile, and a "bad" version of the plugin-help.xml resource, provided you set the flag to tell it to not stop if there are no annotations found. If the descriptor goal is then run after the compile step, it regenerates the correct plugin-help.xml resource and puts it into the compiled output in the right spot (since it's a resource, it doesn't need to be compiled).

      This is how the workaround proposed by MNG-5346 works.

      Workaround this here by setting the phase for the maven-plugin-plugin descriptor to run after compile, and setting the configuration to <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>. Note that build steps that want to invoke this have to specify the plugin in their build plugins configuration, and use the id "default-descriptor", if they have additional configuration needed.

      Attachments

        Issue Links

          Activity

            People

              schor Marshall Schor
              schor Marshall Schor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: