Class MavenAetherUtils


  • public class MavenAetherUtils
    extends java.lang.Object
    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

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger LOGGER  
      private static java.lang.String NO_SUCH_REALM_EXCEPTION  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void importAether​(java.lang.ClassLoader classLoader)
      Imports aether-util library from the user's Maven distribution.
      static void importAetherLibrary()
      Import the core Aether library from the maven distribution.
      private static boolean isClassRealm​(java.lang.ClassLoader classLoader)
      Using reflection, check if the Classloader is actually an instance of a ClassRealm.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • NO_SUCH_REALM_EXCEPTION

        private static final java.lang.String NO_SUCH_REALM_EXCEPTION
        See Also:
        Constant Field Values
    • Constructor Detail

      • MavenAetherUtils

        public MavenAetherUtils()
    • Method Detail

      • importAetherLibrary

        public static void importAetherLibrary()
        Import the core Aether library from the maven distribution.
      • importAether

        private static void importAether​(java.lang.ClassLoader classLoader)
        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

        private static boolean isClassRealm​(java.lang.ClassLoader classLoader)
        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.