Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5422

Plexus Components not Injected to AntMojoWrapper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Auto Closed
    • 3.0.3
    • None
    • Plugins and Lifecycle
    • None
    • OS X 10.7.5

    Description

      I am attempting to build a Maven plugin written in Ant, using the AntMojoWrapper API.

      Upon configuring the MavenProjectHelper in *.mojos.xml as follows:

      <parameter>
         <name>projectHelper</name>   <expression>${component.org.apache.maven.project.MavenProjectHelper#maven.project.helper}</expression>
         <description>maven project helper object</description>
      </parameter>

      I see where the requirements entry is written to the plugin.xml:

      <requirement>
         <role>org.apache.maven.project.MavenProjectHelper</role>
         <role-hint>maven.project.helper</role-hint>
         <field-name>projectHelper</field-name>
      </requirement>

      But when executing the plugin, I don't believe the component is added as an Ant reference. I believe this should happen in org.codehaus.plexus.component.factory.ant.AntScriptInvoker but I never see the addComponentRequirement get called.

      I am using:

      <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-script-ant</artifactId>
         <version>2.2.1</version>
      </dependency>
      
      <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-plugin-api</artifactId>
         <version>2.0</version>
      </dependency>
      
      <dependency>
         <groupId>org.apache.maven.plugin-tools</groupId>
         <artifactId>maven-plugin-tools-ant</artifactId>
         <version>3.2</version>
      </dependency>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            apemberton Andy Pemberton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: