Class ManifestResourceTransformer
- java.lang.Object
-
- org.apache.maven.plugins.shade.resource.ManifestResourceTransformer
-
- All Implemented Interfaces:
ResourceTransformer
public class ManifestResourceTransformer extends java.lang.Object implements ResourceTransformer
A resource processor that allows the arbitrary addition of attributes to the first MANIFEST.MF that is found in the set of JARs being processed, or to a newly created manifest for the shaded JAR.- Since:
- 1.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
mainClass
private java.util.jar.Manifest
manifest
private boolean
manifestDiscovered
private java.util.Map<java.lang.String,java.lang.Object>
manifestEntries
-
Constructor Summary
Constructors Constructor Description ManifestResourceTransformer()
-
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)
Transform an individual resource
-
-
-
Method Detail
-
canTransformResource
public boolean canTransformResource(java.lang.String resource)
- Specified by:
canTransformResource
in interfaceResourceTransformer
-
processResource
public void processResource(java.lang.String resource, java.io.InputStream is, java.util.List<Relocator> relocators) throws java.io.IOException
Description copied from interface:ResourceTransformer
Transform an individual resource- Specified by:
processResource
in interfaceResourceTransformer
- Parameters:
resource
- The resoure nameis
- An input stream for the resource, the implementation should *not* close this streamrelocators
- A list of relocators- Throws:
java.io.IOException
- When the IO blows up
-
hasTransformedResource
public boolean hasTransformedResource()
- Specified by:
hasTransformedResource
in interfaceResourceTransformer
-
modifyOutputStream
public void modifyOutputStream(java.util.jar.JarOutputStream jos) throws java.io.IOException
- Specified by:
modifyOutputStream
in interfaceResourceTransformer
- Throws:
java.io.IOException
-
-