Class PluginLoader


  • public class PluginLoader
    extends java.lang.Object
    Java agent for loading plugin JARs from a specified directory into the system classpath before the main application starts. This allows additional plugins to be available at runtime by appending their JAR files to the system class loader search path; while allowing use of an executable jar with deterministic classpath ordering.

    To use, specify this class as a Java agent and provide the plugins directory as the -javaagent argument

    • Constructor Summary

      Constructors 
      Constructor Description
      PluginLoader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void premain​(java.lang.String agentArg, java.lang.instrument.Instrumentation inst)
      Java agent entry point.
      • Methods inherited from class java.lang.Object

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

      • PluginLoader

        public PluginLoader()
    • Method Detail

      • premain

        public static void premain​(java.lang.String agentArg,
                                   java.lang.instrument.Instrumentation inst)
        Java agent entry point. Loads all JAR files from the specified plugins directory and appends them to the system class loader search path.
        Parameters:
        agentArg - the path to the plugins directory containing JAR files to load, e.g `-javaagent:cli.jar=/usr/share/dependency-check/plugins`
        inst - the instrumentation instance provided by the JVM