Class MavenAetherUtils
java.lang.Object
org.apache.maven.shared.transfer.project.MavenAetherUtils
This util class will import the Aether library available from the installed Maven distribution. It will do nothing if
it is called from outside of a ClassRealm.
- Since:
- 0.11.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidimportAether(ClassLoader classLoader) Imports aether-util library from the user's Maven distribution.static voidImport the core Aether library from the maven distribution.private static booleanisClassRealm(ClassLoader classLoader) Using reflection, check if the Classloader is actually an instance of a ClassRealm.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
NO_SUCH_REALM_EXCEPTION
- See Also:
-
-
Constructor Details
-
MavenAetherUtils
public MavenAetherUtils()
-
-
Method Details
-
importAetherLibrary
public static void importAetherLibrary()Import the core Aether library from the maven distribution. -
importAether
Imports aether-util library from the user's Maven distribution.PRECONDITION: the classLoader parameter is an instance of ClassRealm.
- Parameters:
classLoader- the Classloader which needs to access aether-util.
-
isClassRealm
Using reflection, check if the Classloader is actually an instance of a ClassRealm.- Parameters:
classLoader- the Classloader to test.- Returns:
- true if it an instance of ClassRealm; false otherwise.
-