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 <https://twitter.com/rmannibucau> | Blog <https://rmannibucau.metawerx.net/> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <https://www.packtpub.com/application-development/java-ee-8-high-performance> Le ven. 29 juil. 2022 à 16:34, Konrad Windszus <[email protected]> a écrit : > 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://issues.apache.org/jira/browse/MNG-7524. > > Thanks, > Konrad > > On 2022/07/29 14:27:05 Jorge Solórzano wrote: > > 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 > > <https://github.com/eclipse/sisu.inject/releases/tag/releases%2F0.3.5>, > > and there > > is a pre-release of Sisu (0.9.0.M1 > > < > https://github.com/eclipse/sisu.inject/releases/tag/milestones%2F0.9.0.M1 > >) > > that includes the PathTypeConverter > > <https://github.com/eclipse/sisu.inject/pull/39> (available in > 0.9.0.M1), > > yet this means that right now it's not possible to use > java.nio.file.Path. > > > > So yes, you are bound to using File parameters, yet it's pretty easy to > > convert from/to Path using File.toPath() > > <https://docs.oracle.com/javase/7/docs/api/java/io/File.html#toPath()> > > > > On Fri, Jul 29, 2022 at 4:06 PM Konrad Windszus <[email protected]> wrote: > > > > > > 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 which is used for > > coercion/construction. > > > That is true for > > > https://docs.oracle.com/javase/7/docs/api/java/io/File.html#File(java.lang.String) > > but not for > > https://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html. Is > there > > already a ticket for supporting NIO Path parameters? > > > > > > Which tool is used for doing the injection of parameters under the > hood? > > Is that also Eclipse Sisu? > > > It would be really nice to extend > > > https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Mapping_Complex_Objects > > and > > > https://maven.apache.org/guides/mini/guide-configuring-plugins.html#mapping-simple-objects > > a bit, as it does not really state how the object is actually > instantiated. > > Is it using the default constructor and field reflection only? If so, how > > does it do type coercion as everything given in the pom.xml or on the CLI > > is a String? > > > > > > Thanks in advance for giving some insights on this, > > > Konrad > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: [email protected] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
