You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2018/04/17 07:33:00 UTC

[jira] [Commented] (MPLUGINTESTING-56) @Parameter is ignored

    [ https://issues.apache.org/jira/browse/MPLUGINTESTING-56?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16440528#comment-16440528 ] 

Robert Scholte commented on MPLUGINTESTING-56:
----------------------------------------------

Please attach the xml. Plexus is the CDI framework and doesn't understand Maven annotations. The warning should be "Cannot find field 'hardDiskDrive...'", but it should work with hdd.

> @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)