Class ServicesResourceTransformer
- java.lang.Object
-
- org.apache.maven.plugins.shade.resource.AbstractCompatibilityTransformer
-
- org.apache.maven.plugins.shade.resource.ServicesResourceTransformer
-
- All Implemented Interfaces:
ReproducibleResourceTransformer
,ResourceTransformer
public class ServicesResourceTransformer extends AbstractCompatibilityTransformer
Resources transformer that relocates classes in META-INF/services and appends entries in META-INF/services resources into a single resource. For example, if there are several META-INF/services/org.apache.maven.project.ProjectBuilder resources spread across many JARs the individual entries will all be concatenated into a single META-INF/services/org.apache.maven.project.ProjectBuilder resource packaged into the resultant JAR produced by the shading process.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
serviceEntries
private static java.lang.String
SERVICES_PATH
private long
time
-
Constructor Summary
Constructors Constructor Description ServicesResourceTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canTransformResource(java.lang.String resource)
boolean
hasTransformedResource()
void
modifyOutputStream(java.util.jar.JarOutputStream jos)
void
processResource(java.lang.String resource, java.io.InputStream is, java.util.List<Relocator> relocators, long time)
Transform an individual resource-
Methods inherited from class org.apache.maven.plugins.shade.resource.AbstractCompatibilityTransformer
processResource
-
-
-
-
Field Detail
-
SERVICES_PATH
private static final java.lang.String SERVICES_PATH
- See Also:
- Constant Field Values
-
serviceEntries
private final java.util.Map<java.lang.String,java.util.Set<java.lang.String>> serviceEntries
-
time
private long time
-
-
Method Detail
-
canTransformResource
public boolean canTransformResource(java.lang.String resource)
-
processResource
public void processResource(java.lang.String resource, java.io.InputStream is, java.util.List<Relocator> relocators, long time) throws java.io.IOException
Description copied from interface:ReproducibleResourceTransformer
Transform an individual resource- Parameters:
resource
- The resource nameis
- An input stream for the resource, the implementation should *not* close this streamrelocators
- A list of relocatorstime
- the time of the resource to process- Throws:
java.io.IOException
- When the IO blows up
-
hasTransformedResource
public boolean hasTransformedResource()
-
modifyOutputStream
public void modifyOutputStream(java.util.jar.JarOutputStream jos) throws java.io.IOException
- Throws:
java.io.IOException
-
-