Thanks Robert, I did suspect that it was something to do with the way the
unit test runs was not simulating the phase. I set up a simple test project
using the snapshot of my plugin, and it works as designed, so I'm going to
take that test out and assume that it 'just works'.

Cheers,
KEv.


On Mon, Aug 6, 2018 at 5:39 PM Robert Scholte <[email protected]> wrote:

> On Mon, 06 Aug 2018 18:27:48 +0200, Kev James <[email protected]>
> wrote:
>
> > Hi all,
> > Is this the right place to ask questions about writing Maven plugins? I'm
> > writing a plugin and I have a unit test that tries to verify that the
> > <configuration> in an <execution> is being read (because right now it
> > doesn't, so it's got its own unit test now).
> >
> > This pom is read correctly, and my Mojo's execute() method has the
> > parameters set correctly:
> > ..
> > ..
> > <build>
> > <plugins>
> > <plugin>
> > <artifactId>p2composite-maven-plugin</artifactId>
> > <configuration>
> > <folder>target/test-classes/test5</folder>
> > <repositoryName>test5</repositoryName>
> > </configuration>
> > </plugin>
> > </plugins>
> > </build>
> >
> > However, this pom fails because the  variables holding my parameters are
> > null in the execute() method:
> >
> > ..
> > ..
> > <build>
> >   <plugins>
> >     <plugin>
> >       <artifactId>p2composite-maven-plugin</artifactId>
> >       <executions>
> >         <execution>
> >           <id>check-configuration-works-in-execution</id>
> >           <phase>deploy</phase>
> >           <goals>
> >             <goal>p2composite</goal>
> >           </goals>
> >           <configuration>
> >             <repositoryName>test6</repositoryName>
> >             <folder>target/test-classes/test6</folder>
> >           </configuration>
> >         </execution>
> >       </executions>
> >     </plugin>
> >   </plugins>
> > </build>
>
> If you run 'mvn deploy', this should work. However if you call
> p2composite:p2composite it doesn't, because the plugin is running without
> the execution block. Running it like
> p2composite:p2composite@check-configuration-works-in-execution should
> pick
> up the execution specific configuration.
>
> thanks,
> Robert
>
> >
> > Do I need to do something special? I'm happy to provide more
> information
> > if
> > necessary, I figured I'd start brief and work up..
> >
> > Cheers,
> > Kev.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to