Package com.diffplug.spotless
Class JarState
java.lang.Object
com.diffplug.spotless.JarState
- All Implemented Interfaces:
Serializable
Grabs a jar and its dependencies from maven,
and makes it easy to access the collection in
a classloader.
Serializes the full state of the jar, so it can catch changes in a SNAPSHOT version.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA lazily evaluated JarState, which becomes a set of files when serialized. -
Method Summary
Modifier and TypeMethodDescriptionstatic JarStatefrom(String mavenCoordinate, Provisioner provisioner) Provisions the given maven coordinate and its transitive dependencies.static JarStatefrom(Collection<String> mavenCoordinates, Provisioner provisioner) Provisions the given maven coordinates and their transitive dependencies.Returns a classloader containing the only jars in this JarState.Returns a classloader containing the only jars in this JarState.static JarStatepreserveOrder(Collection<File> jars) Wraps the given collection of a files as a JarState, maintaining the order in the Collection.static JarState.Promisedpromise(ThrowingEx.Supplier<JarState> supplier) static JarStatewithoutTransitives(Collection<String> mavenCoordinates, Provisioner provisioner) Provisions the given maven coordinates without their transitive dependencies.
-
Method Details
-
promise
-
from
Provisions the given maven coordinate and its transitive dependencies.- Throws:
IOException
-
from
public static JarState from(Collection<String> mavenCoordinates, Provisioner provisioner) throws IOException Provisions the given maven coordinates and their transitive dependencies.- Throws:
IOException
-
withoutTransitives
public static JarState withoutTransitives(Collection<String> mavenCoordinates, Provisioner provisioner) throws IOException Provisions the given maven coordinates without their transitive dependencies.- Throws:
IOException
-
preserveOrder
Wraps the given collection of a files as a JarState, maintaining the order in the Collection.- Throws:
IOException
-
getClassLoader
Returns a classloader containing the only jars in this JarState. Look-up of classes in theorg.slf4jpackage are not taken from the JarState, but instead redirected to the class loader of this class to enable passthrough logging.
The lifetime of the underlying cacheloader is controlled bySpotlessCache. -
getClassLoader
Returns a classloader containing the only jars in this JarState. Look-up of classes in theorg.slf4jpackage are not taken from the JarState, but instead redirected to the class loader of this class to enable passthrough logging.
The lifetime of the underlying cacheloader is controlled bySpotlessCache.
-