Re: Writing own plugin: The parameter annotation - does it work?

2018-04-17 Thread Martin Hoeller
Hi Gerrit!

If you search for some examples have a look at
https://github.com/matinh/vdldoc-maven-plugin

I created this project some time ago as a proove of concept for myself
to write a simple maven plugin including integration testing. Use the
"run-its" profile to enable integration-tests and have a look at the
main pom.xml resp. the POMs of the ITs in src/it/*.

hth,
- martin

On Tue, 17 Apr 2018 09:25 wrote :

> With Maven Invoker you create Maven projects like your plugin-users
> do. And then Maven will be called to run this project. It is as close
> as possible to the real world .
> If you want to make unittests, maven-plugin-testing-harness should
> work, but it lacks good documentation.
> Downside of this is that you're testing it with 1 specific version
> of Maven. The takari plugin seems to be able to cover multiple Maven  
> versions, but you won't be able to debug issues for a specific Maven  
> version.
> 
> thanks,
> Robert
> 
> On Tue, 17 Apr 2018 09:16:51 +0200,  wrote:
> 
> > Hi Robert,
> >
> > thanks a lot for your mail.
> > I create 2 issues about this.
> >
> > About that Maven Invoker Plugin:
> > Are there any examples how to use that in a JUnit test?
> >
> > Regards,
> > Gerrit


pgpo1YVvHWSLr.pgp
Description: Digitale Signatur von OpenPGP


Re: Writing own plugin: The parameter annotation - does it work?

2018-04-16 Thread Mark Raynsford
On 2018-04-16T09:26:08 +0200
 wrote:
>
> Until then proper Maven Plug-in testing is not possible using JUnit - 
> especially not if it is in the IDE (Eclipse+M2E) and not during the Maven 
> build.
> 

I came to the same conclusion (at least with the plain testing
harness). I switched to takari-plugin-testing, which seems to have been
written at least in part as a reaction to the fact that nothing else
worked properly.

I have a very small project that can serve as an example of how to use
it:

  https://github.com/io7m/minisite

Take a look at the com.io7m.minisite.tests module. Primarily the
MinSiteMojoTest class, and the takari plugin execution in the tests
module pom. I can attest that it does work from inside the IDE, but you
may need to run an initial build to run the plugin's testProperties
goal (Eclipse & M2E may be able to do this for you these days, I'm not
sure).

-- 
Mark Raynsford | http://www.io7m.com



pgpjIFyPlMKZV.pgp
Description: OpenPGP digital signature