Package com.ranull.graves.util
Class LibraryLoaderUtil
java.lang.Object
com.ranull.graves.util.LibraryLoaderUtil
Utility class for loading external libraries dynamically using BukkitLibraryManager.
This class provides methods to load libraries from Maven repositories, with support for relocation and isolation of the loaded libraries.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLibraryLoaderUtil
(Graves plugin) Constructs a new LibraryLoaderUtil instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
loadLibrary
(String groupID, String artifactID, String version) Loads a library with the specified group ID, artifact ID, and version.void
loadLibrary
(String groupID, String artifactID, String version, boolean isIsolated) Loads a library with the specified group ID, artifact ID, version, and isolation setting.void
loadLibrary
(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.void
loadLibrary
(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, boolean resolveTransitiveDependencies) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.void
loadLibrary
(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, String libraryURL) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.void
loadLibrary
(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, String libraryURL, boolean resolveTransitiveDependencies) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.void
loadLibrary
(String groupID, String artifactID, String version, String ID, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, String libraryURL, boolean resolveTransitiveDependencies) Loads a library with the specified group ID, artifact ID, version, ID, relocation patterns, and isolation setting.
-
Field Details
-
plugin
-
-
Constructor Details
-
LibraryLoaderUtil
Constructs a new LibraryLoaderUtil instance.- Parameters:
plugin
- The plugin instance to associate with the library manager.
-
-
Method Details
-
loadLibrary
Loads a library with the specified group ID, artifact ID, and version.Uses default settings for relocation, ID, and isolation.
- Parameters:
groupID
- The group ID of the library.artifactID
- The artifact ID of the library.version
- The version of the library.
-
loadLibrary
Loads a library with the specified group ID, artifact ID, version, and isolation setting.Uses default settings for relocation and ID.
- Parameters:
groupID
- The group ID of the library.artifactID
- The artifact ID of the library.version
- The version of the library.isIsolated
- Whether to load the library in an isolated class loader.
-
loadLibrary
public void loadLibrary(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.Uses default settings for ID.
- Parameters:
groupID
- The group ID of the library.artifactID
- The artifact ID of the library.version
- The version of the library.relocatePattern
- The package pattern to relocate.relocateRelocatedPattern
- The relocated package pattern.isIsolated
- Whether to load the library in an isolated class loader.
-
loadLibrary
public void loadLibrary(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, boolean resolveTransitiveDependencies) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.Uses default settings for ID.
- Parameters:
groupID
- The group ID of the library.artifactID
- The artifact ID of the library.version
- The version of the library.relocatePattern
- The package pattern to relocate.relocateRelocatedPattern
- The relocated package pattern.isIsolated
- Whether to load the library in an isolated class loader.resolveTransitiveDependencies
- Determines whether to resolve Transitive Dependencies.
-
loadLibrary
public void loadLibrary(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, String libraryURL) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.Uses default settings for ID.
- Parameters:
groupID
- The group ID of the library.artifactID
- The artifact ID of the library.version
- The version of the library.relocatePattern
- The package pattern to relocate.relocateRelocatedPattern
- The relocated package pattern.isIsolated
- Whether to load the library in an isolated class loader.libraryURL
- Points to an external library URL to a repository.
-
loadLibrary
public void loadLibrary(String groupID, String artifactID, String version, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, String libraryURL, boolean resolveTransitiveDependencies) Loads a library with the specified group ID, artifact ID, version, relocation patterns, and isolation setting.Uses default settings for ID.
- Parameters:
groupID
- The group ID of the library.artifactID
- The artifact ID of the library.version
- The version of the library.relocatePattern
- The package pattern to relocate.relocateRelocatedPattern
- The relocated package pattern.isIsolated
- Whether to load the library in an isolated class loader.libraryURL
- Points to an external library URL to a repository.resolveTransitiveDependencies
- Determines whether to resolve Transitive Dependencies.
-
loadLibrary
public void loadLibrary(String groupID, String artifactID, String version, String ID, String relocatePattern, String relocateRelocatedPattern, boolean isIsolated, String libraryURL, boolean resolveTransitiveDependencies) Loads a library with the specified group ID, artifact ID, version, ID, relocation patterns, and isolation setting.Configures the library with optional ID and relocation settings, and loads it using the BukkitLibraryManager.
- Parameters:
groupID
- The group ID of the library.artifactID
- The artifact ID of the library.version
- The version of the library.ID
- Optional ID for the library.relocatePattern
- Optional package pattern to relocate.relocateRelocatedPattern
- Optional relocated package pattern.isIsolated
- Whether to load the library in an isolated class loader.libraryURL
- Points to an external library URL to a repository.resolveTransitiveDependencies
- Determines whether to resolve Transitive Dependencies.
-