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

invalid requirement role generated in plugin.xml

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.5
    • Fix Version/s: 3.5.1
    • Labels:
      None

      Description

      I ran into this issue when attempting to build a fork of the versions-maven-plugin:

      In the plugin.xml the following is generated:

            <requirements>
              <requirement>
                <role>org$apache$maven$artifact$resolver$ArtifactResolver</role>
                <field-name>resolver</field-name>
              </requirement>
            </requirements>
      

      The $ should be dots.

      This only seems to happen when your field is declared with a fully qualified classname, and the class is also imported. If I remove the import or the fully qualified classname, the problem disappears.

      package plugin.bug;
      
      import org.apache.maven.plugin.AbstractMojo;
      import org.apache.maven.plugin.MojoExecutionException;
      import org.apache.maven.plugin.MojoFailureException;
      import org.apache.maven.artifact.resolver.ArtifactResolver;
      
      /**
       * @goal foo
       */
      public class FooMojo extends AbstractMojo {
      
      	/**
      	 * @component
      	 */
      	private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
      
      	public void execute() throws MojoExecutionException, MojoFailureException {
      	}
      
      }
      

      It works in version 3.3.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gboue Guillaume Boué
                Reporter:
                jpraet Jimmy Praet
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: