Class UriPlexusConverter
- All Implemented Interfaces:
org.codehaus.plexus.component.configurator.converters.ConfigurationConverter
We provide this to avoid using the URL and File APIs in the Mojo interface. URLs do an
immediate lookup for the URL scheme's appropriate URLStreamHandlerProvider upon construction, and
we have no control over how that works. We have no ability to inject custom URL handlers at this
point because the URL class is hardcoded to only consider the system classloader. Since Maven
uses ClassWorlds to run multiple classloaders for each plugin and component, we will not be
loaded as part of that default classloader. By deferring this operation to as late as possible
(i.e. in UriResourceFetcher
), we can
ensure we provide the desired URL handler directly instead. This allows us to hook custom URL
handlers in via ServiceLoader
dynamically, like we would be able to outside a
Maven plugin running in Plexus.
Newer versions of Plexus/Sisu provide this for us, so in the future, we can remove these components (looks to be supported from Maven 3.9.x).
- Since:
- 3.1.3
- Author:
- Ashley Scopes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Class<?> type) protected Object
fromString
(String str) Methods inherited from class org.codehaus.plexus.component.configurator.converters.basic.AbstractBasicConverter
fromConfiguration, fromExpression, fromString
Methods inherited from class org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter
failIfNotTypeCompatible, fromConfiguration, fromExpression, fromExpression, fromXML, getClassForImplementationHint, instantiateObject
-
Constructor Details
-
UriPlexusConverter
public UriPlexusConverter()
-
-
Method Details
-
canConvert
-
fromString
protected Object fromString(String str) throws org.codehaus.plexus.component.configurator.ComponentConfigurationException - Overrides:
fromString
in classorg.codehaus.plexus.component.configurator.converters.basic.AbstractBasicConverter
- Throws:
org.codehaus.plexus.component.configurator.ComponentConfigurationException
-