Don't mix in plexus (is dead). You need Guice spi TypeConverter.

T

On Fri, Jul 29, 2022, 16:22 Romain Manni-Bucau <[email protected]>
wrote:

> 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/27a29dc633e6b03753a3c8d29a033648630c8831/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/lookup/DefaultConverterLookup.java#L46
> so supporting Path is mainly about adding a PathConverter inspired from
> FileConverter (
>
> https://github.com/eclipse/sisu.plexus/blob/27a29dc633e6b03753a3c8d29a033648630c8831/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/basic/FileConverter.java#L23
> ).
>
> We could have a constructor or factory support like in JAX-RS or most CLI
> libraries (fromString, Parse, of etc) but not sure the actual usage so
> maybe just supporting the JVM types is sufficient.
>
> Hope it helps.
>
> 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:06, Konrad Windszus <[email protected]> a écrit :
>
> > 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]
> >
> >
>

Reply via email to