Hi,
I am not sure this is the right mailing-list.
Maybe I should have posted to the dev list. Anyway...
I have started working on new Maven plug-in last week and I have set up
unit tests using the testing-harness plugin.
I have problems with Maven injected fields, such as the Maven project.
I use the Maven libraries version 3.2.2, and the harness plugin in
version 3.2.0.
My mojo has an injected field...
This field is correctly set when I run the plugin normally.
But it is null when I use the harness plugin. Here is the code in my test.
The NPE occurs in the execute method.
The documentation indicates we have (or had) to use a stub. [0]
So, so far, I guess it makes sense (I guess, because unless you read
this page [0], it is not clear on the web site that injected fields will
not work).
The JIRA entry [1] states we can also use
MojoRule#lookupConfiguredMojo() to have a mojo configured with the
default settings.
But when I use it, that is to say...
... I get the following exception.
=> Invalid repository system session: LocalRepositoryManager is not set.
I have been struggling with this the entire afternoon.
Any help would be appreciated.
I can submit the sources of the plugin if necessary.
Thanks,
Vincent.
[ 0 ] :
http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/examples/complex-mojo-parameters.html
[ 1 ] : http://jira.codehaus.org/browse/MPLUGINTESTING-23
Twitter <https://twitter.com/VincentZurczak> Vincent Zurczak @ LinkedIn
<http://fr.linkedin.com/pub/vincent-zurczak/18/b35/6a7> My Skype ID
<callto://vincent.zurczak> My English blog <http://vzurczak.wordpress.com>
I am not sure this is the right mailing-list.
Maybe I should have posted to the dev list. Anyway...
I have started working on new Maven plug-in last week and I have set up
unit tests using the testing-harness plugin.
I have problems with Maven injected fields, such as the Maven project.
I use the Maven libraries version 3.2.2, and the harness plugin in
version 3.2.0.
My mojo has an injected field...
This field is correctly set when I run the plugin normally.
But it is null when I use the harness plugin. Here is the code in my test.
The NPE occurs in the execute method.
The documentation indicates we have (or had) to use a stub. [0]
So, so far, I guess it makes sense (I guess, because unless you read
this page [0], it is not clear on the web site that injected fields will
not work).
The JIRA entry [1] states we can also use
MojoRule#lookupConfiguredMojo() to have a mojo configured with the
default settings.
But when I use it, that is to say...
... I get the following exception.
=> Invalid repository system session: LocalRepositoryManager is not set.
I have been struggling with this the entire afternoon.
Any help would be appreciated.
I can submit the sources of the plugin if necessary.
Thanks,
Vincent.
[ 0 ] :
http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/examples/complex-mojo-parameters.html
[ 1 ] : http://jira.codehaus.org/browse/MPLUGINTESTING-23
Twitter <https://twitter.com/VincentZurczak> Vincent Zurczak @ LinkedIn
<http://fr.linkedin.com/pub/vincent-zurczak/18/b35/6a7> My Skype ID
<callto://vincent.zurczak> My English blog <http://vzurczak.wordpress.com>