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

[maven-plugin-testing-harness-1.0-beta-1] AbstractMojoTestCase.extractPluginConfiguration expects plugin configuration directly under plugin (configuration under executions/execution doesn't work)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.4
    • None
    • None
    • Maven 2.0.4
      maven-plugin-testing-harness-1.0-beta-1

    Description

      AbstractMojoTestCase.extractPluginConfiguration expects plugin configuration directly under plugin. configuration section under executions/execution doesn't work.

      Exception is thrown on line 209 since pluginConfigurationElement == null which is due to

      pluginConfigurationElement = pluginElement.getChild( "configuration" )
      

      A fix should check for configuration section under plugin/configuration and then plugin/executions/execution/configuration.

      AbstractMojoTestCase.extractPluginConfiguration:201
      
              for ( int i = 0; i < pluginElements.length; i++ )
              {
                  Xpp3Dom pluginElement = pluginElements[i];
      
                  String pluginElementArtifactId = pluginElement.getChild( "artifactId" ).getValue();
      
                  if ( pluginElementArtifactId.equals( artifactId ) )
                  {
                      pluginConfigurationElement = pluginElement.getChild( "configuration" );
      
                      break;
                  }
              }
      
              if ( pluginConfigurationElement == null )
              {
                  throw new ConfigurationException( "Cannot find a configuration element for a plugin with an artifactId of " + artifactId + "." );
              }
      

      Attachments

        Activity

          People

            siveton Siveton Vincent
            jimisola Jimisola Laursen
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: