Package net.bytebuddy.build.maven
Class ByteBuddyMojo.ForExplicitLocations
java.lang.Object
org.apache.maven.plugin.AbstractMojo
net.bytebuddy.build.maven.ByteBuddyMojo
net.bytebuddy.build.maven.ByteBuddyMojo.ForExplicitLocations
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
ByteBuddyMojo.ForExplicitLocations.ForTestTypes
,ByteBuddyMojo.ForExplicitLocations.WithExtendedDependencies
,ByteBuddyMojo.ForExplicitLocations.WithoutRuntimeDependencies
,ByteBuddyMojo.ForExplicitLocations.WithRuntimeDependencies
- Enclosing class:
ByteBuddyMojo
@Mojo(name="transform-location-empty",
defaultPhase=PROCESS_CLASSES,
threadSafe=true)
public static class ByteBuddyMojo.ForExplicitLocations
extends ByteBuddyMojo
Transforms specified classes from files in a folder or a jar file to a folder or jar file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Transforms specified classes from files in a folder or a jar file to a folder or jar file.static class
Transforms specified classes from files in a folder or a jar file to a folder or jar file.static class
Transforms specified classes from files in a folder or a jar file to a folder or jar file.static class
Transforms specified classes from files in a folder or a jar file to a folder or jar file.Nested classes/interfaces inherited from class net.bytebuddy.build.maven.ByteBuddyMojo
ByteBuddyMojo.Coordinate, ByteBuddyMojo.ForDependencyFolder, ByteBuddyMojo.ForExplicitLocations, ByteBuddyMojo.ForLifecycleTypes, ByteBuddyMojo.MavenBuildLogger, ByteBuddyMojo.StalenessFilter, ByteBuddyMojo.TransformationLogger, ByteBuddyMojo.Transformer
-
Field Summary
FieldsModifier and TypeFieldDescriptionA list of dependencies to be included when resolving class files, additionally to the source jar.The source folder or jar file that should be transformed.The target folder or jar file to where the transformed sources should be written to.Fields inherited from class net.bytebuddy.build.maven.ByteBuddyMojo
classPathDiscovery, discovery, execution, extendedParsing, failFast, failOnLiveInitializer, initialization, multiReleaseVersion, project, repositorySystem, repositorySystemSession, skip, staleMilliseconds, suffix, threads, transformations, warnOnEmptyTypeSet, warnOnMissingOutputDirectory
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
apply
(List<ByteBuddyMojo.Transformer> transformers, List<String> elements, Map<ByteBuddyMojo.Coordinate, String> coordinates) Applies this mojo for the given setup.resolveClassPathElements
(Map<ByteBuddyMojo.Coordinate, String> coordinates) Resolves the class path elements of the relevant output directory.Resolves any implicit dependencies that should be added to the class path.Methods inherited from class net.bytebuddy.build.maven.ByteBuddyMojo
execute, transform
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
source
The source folder or jar file that should be transformed. -
target
The target folder or jar file to where the transformed sources should be written to. -
dependencies
A list of dependencies to be included when resolving class files, additionally to the source jar.
-
-
Constructor Details
-
ForExplicitLocations
public ForExplicitLocations()
-
-
Method Details
-
resolveClassPathElements
protected List<String> resolveClassPathElements(Map<ByteBuddyMojo.Coordinate, String> coordinates) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionDescription copied from class:ByteBuddyMojo
Resolves the class path elements of the relevant output directory.- Specified by:
resolveClassPathElements
in classByteBuddyMojo
- Parameters:
coordinates
- Versions for managed dependencies.- Returns:
- The class path elements of the relevant output directory.
- Throws:
org.apache.maven.plugin.MojoExecutionException
- If the user configuration results in an error.org.apache.maven.plugin.MojoFailureException
- If the plugin application raises an error.
-
resolveImplicitClassPathElements
protected List<String> resolveImplicitClassPathElements() throws org.apache.maven.plugin.MojoFailureExceptionResolves any implicit dependencies that should be added to the class path.- Returns:
- The class path elements of the relevant output directory.
- Throws:
org.apache.maven.plugin.MojoFailureException
- If the class loader resolution yields a failure.
-
apply
protected void apply(List<ByteBuddyMojo.Transformer> transformers, List<String> elements, Map<ByteBuddyMojo.Coordinate, String> coordinates) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException, IOExceptionDescription copied from class:ByteBuddyMojo
Applies this mojo for the given setup.- Specified by:
apply
in classByteBuddyMojo
- Parameters:
transformers
- The transformers to apply.elements
- The class path elements to consider.coordinates
- Versions for managed dependencies.- Throws:
org.apache.maven.plugin.MojoExecutionException
- If the plugin fails due to a user error.org.apache.maven.plugin.MojoFailureException
- If the plugin fails due to an application error.IOException
- If an I/O exception occurs.
-