Re: Mojo parameters of type java.nio.file.Path

2022-08-01 Thread Konrad Windszus
Hi Stuart, thanks a lot for the valuable input, I finalised the PR at https://github.com/eclipse/sisu.plexus/pull/22 and added some tests for path injections (as a start). Regarding the converters being used, I already figured out that an arbitrary class with a string constructor does not work

Re: Mojo parameters of type java.nio.file.Path

2022-07-31 Thread Romain Manni-Bucau
Guess we should plan that+support mojo jar hosted converters for mvn 4? For mvn 3 gain would be low since it would couple mojo to mvn version too much probably as of today. Wdyt? Le dim. 31 juil. 2022 à 11:40, Stuart McCulloch a écrit : > That's correct, Maven still uses the Plexus configuratio

Re: Mojo parameters of type java.nio.file.Path

2022-07-31 Thread Stuart McCulloch
That's correct, Maven still uses the Plexus configuration API to convert XML configuration to mojo parameters. Sisu looks for the best matching converter as follows for Plexus configuration requests: 1. custom converters registered via ConverterLookup (Plexus API) 2. built-in converters that mimi

Re: Mojo parameters of type java.nio.file.Path

2022-07-31 Thread Konrad Windszus
At least for Maven 3.8.6 this is not true. Plexus Container API is still used in https://github.com/apache/maven/blob/84538c9988a25aec085021c365c560670ad80f63/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L625 A complete stack trace for injecting File pa

Re: Mojo parameters of type java.nio.file.Path

2022-07-29 Thread Tamás Cservenák
Don't mix in plexus (is dead). You need Guice spi TypeConverter. T On Fri, Jul 29, 2022, 16:22 Romain Manni-Bucau wrote: > Hi Konrad, > > Guess what you are looking for is > > https://github.com/eclipse/sisu.plexus/blob/27a29dc633e6b03753a3c8d29a033648630c8831/org.eclipse.sisu.plexus/src/org/ec

Re: Mojo parameters of type java.nio.file.Path

2022-07-29 Thread Romain Manni-Bucau
Injections can work, the small note on path converter is that it must have the same handling than file one and be relative to basedir by default probably (and not the working dir) which seems missed in the linked commit. Romain Manni-Bucau @rmannibucau | Blog

Re: Mojo parameters of type java.nio.file.Path

2022-07-29 Thread Konrad Windszus
I now created https://github.com/eclipse/sisu.plexus/issues/21, but I am not sure if we always need a dedicated plexus converter or the Plexus shim can also rely on the one provided by Sisu.Inject. As soon as I have some feedback in the ticket I am gonna work on a PR for it and also for https://

Re: Mojo parameters of type java.nio.file.Path

2022-07-29 Thread Jorge Solórzano
Hi Konrad, If I'm not wrong, Eclipse Sisu handles the conversion of parameters, so yes right now only java.io.File type is supported. Maven currently uses Sisu 0.3.5 , and there is a pre-release of Sisu (0.9.0.M1

Re: Mojo parameters of type java.nio.file.Path

2022-07-29 Thread Konrad Windszus
Thanks for the answer. I meanwhile found https://github.com/eclipse/sisu.inject/commit/2676001d31a06fe94d2d9a167c5f078c2eba4f5a, but IMHO SISU 0.9.0-M1 is not used in any released Maven yet, so for the time being I am bound to using File parameters, right? Konrad On 2022/07/29 14:21:57 Romain

Re: Mojo parameters of type java.nio.file.Path

2022-07-29 Thread Romain Manni-Bucau
Hi Konrad, Guess what you are looking for is https://github.com/eclipse/sisu.plexus/blob/27a29dc633e6b03753a3c8d29a033648630c8831/org.eclipse.sisu.plexus/src/org/eclipse/sisu/plexus/CompositeBeanHelper.java#L250 which uses https://github.com/eclipse/sisu.plexus/blob/27a29dc633e6b03753a3c8d29a03364

Mojo parameters of type java.nio.file.Path

2022-07-29 Thread Konrad Windszus
Hi, According to https://maven.apache.org/guides/plugin/guide-java-plugin-development.html#files-and-directories only java.io.File type parameters are supported for dealing with file paths. I was assuming that every complex type is supported which has a constructor taking a single String value