Class ServicesResourceTransformer
- java.lang.Object
-
- org.apache.maven.plugins.shade.resource.ServicesResourceTransformer
-
- All Implemented Interfaces:
ResourceTransformer
public class ServicesResourceTransformer extends Object implements ResourceTransformer
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.
-
-
Constructor Summary
Constructors Constructor Description ServicesResourceTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanTransformResource(String resource)booleanhasTransformedResource()voidmodifyOutputStream(JarOutputStream jos)voidprocessResource(String resource, InputStream is, List<Relocator> relocators)Transform an individual resource
-
-
-
Method Detail
-
canTransformResource
public boolean canTransformResource(String resource)
- Specified by:
canTransformResourcein interfaceResourceTransformer
-
processResource
public void processResource(String resource, InputStream is, List<Relocator> relocators) throws IOException
Description copied from interface:ResourceTransformerTransform an individual resource- Specified by:
processResourcein interfaceResourceTransformer- Parameters:
resource- The resoure nameis- An input stream for the resource, the implementation should *not* close this streamrelocators- A list of relocators- Throws:
IOException- When the IO blows up
-
hasTransformedResource
public boolean hasTransformedResource()
- Specified by:
hasTransformedResourcein interfaceResourceTransformer
-
modifyOutputStream
public void modifyOutputStream(JarOutputStream jos) throws IOException
- Specified by:
modifyOutputStreamin interfaceResourceTransformer- Throws:
IOException
-
-