public final class JarState
extends java.lang.Object
implements java.io.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.
| Constructor and Description |
|---|
JarState(java.util.Collection<java.lang.String> mavenCoordinates,
FileSignature fileSignature,
java.util.Set<java.io.File> jars)
Deprecated.
|
JarState(java.lang.String mavenCoordinate,
FileSignature fileSignature,
java.util.Set<java.io.File> jars)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static JarState |
from(java.util.Collection<java.lang.String> mavenCoordinates,
Provisioner provisioner)
Provisions the given maven coordinates and their transitive dependencies.
|
static JarState |
from(java.lang.String mavenCoordinate,
Provisioner provisioner)
Provisions the given maven coordinate and its transitive dependencies.
|
java.lang.ClassLoader |
getClassLoader()
Returns a classloader containing the only jars in this JarState.
|
java.lang.ClassLoader |
getClassLoader(java.io.Serializable key)
Returns a classloader containing the only jars in this JarState.
|
java.util.Set<java.lang.String> |
getMavenCoordinates()
Returns unmodifiable view on sorted Maven coordinates
|
static JarState |
withoutTransitives(java.util.Collection<java.lang.String> mavenCoordinates,
Provisioner provisioner)
Provisions the given maven coordinates without their transitive dependencies.
|
@Deprecated
public JarState(java.lang.String mavenCoordinate,
FileSignature fileSignature,
java.util.Set<java.io.File> jars)
@Deprecated
public JarState(java.util.Collection<java.lang.String> mavenCoordinates,
FileSignature fileSignature,
java.util.Set<java.io.File> jars)
public static JarState from(java.lang.String mavenCoordinate, Provisioner provisioner) throws java.io.IOException
Provisions the given maven coordinate and its transitive dependencies.
java.io.IOExceptionpublic static JarState from(java.util.Collection<java.lang.String> mavenCoordinates, Provisioner provisioner) throws java.io.IOException
Provisions the given maven coordinates and their transitive dependencies.
java.io.IOExceptionpublic static JarState withoutTransitives(java.util.Collection<java.lang.String> mavenCoordinates, Provisioner provisioner) throws java.io.IOException
Provisions the given maven coordinates without their transitive dependencies.
java.io.IOExceptionpublic java.lang.ClassLoader getClassLoader()
Returns a classloader containing the only jars in this JarState.
Look-up of classes in the org.slf4j package
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 by AutostyleCache.
public java.lang.ClassLoader getClassLoader(java.io.Serializable key)
Returns a classloader containing the only jars in this JarState.
Look-up of classes in the org.slf4j package
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 by AutostyleCache.
public java.util.Set<java.lang.String> getMavenCoordinates()
Returns unmodifiable view on sorted Maven coordinates