[
https://issues.apache.org/jira/browse/MPLUGINTESTING-56?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16440538#comment-16440538
]
Gerrit Hohl commented on MPLUGINTESTING-56:
-------------------------------------------
Have to look for the plugin.xml as I'm already working on a different project.
I'm aware that the test suite doesn't directly evaluate the Maven annotations,
but the plugin.xml. But last week I dug into the code a little bit and had to
realize, that the test suite does need the plugin.xml, but the parameters are
injected purely by Java reflection. It doesn't care for any information of the
plugin.xml in aspect of parameters.
> @Parameter is ignored
> ---------------------
>
> Key: MPLUGINTESTING-56
> URL: https://issues.apache.org/jira/browse/MPLUGINTESTING-56
> Project: Maven Plugin Testing
> Issue Type: Bug
> Components: plugin-testing-harness
> Affects Versions: 3.3.0
> Reporter: Gerrit Hohl
> Priority: Major
>
> I tried to test a Mojo which had the following property (example):
> {{@Parameter(name="hardDiskDrive")}}
> {{private String hdd;}}
> The test couldn't find the parameter always saying that there is no
> "hardDiskDrive" parameter:
> {{org.codehaus.plexus.component.configurator.ComponentConfigurationException:
> Cannot find 'hardDiskDrive' in class test.example.MyMojo}}
> {{ at
> org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:252)}}
> {{ at
> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:101)}}
> {{ at
> org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:34)}}
> {{ at
> org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:44)}}
> {{ at
> org.apache.maven.plugin.testing.AbstractMojoTestCase.lookupConfiguredMojo(AbstractMojoTestCase.java:484)}}
> {{ at
> org.apache.maven.plugin.testing.MojoRule.lookupConfiguredMojo(MojoRule.java:197)}}
> {{ [...]}}
> The same applies also to the required option of the @Parameter annotation. It
> also is totally ignored and you'll get a NullPointerException somewhere in
> your code instead.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)