Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (29 loc) · 1.06 KB

SHADE-README.md

File metadata and controls

31 lines (29 loc) · 1.06 KB

To use metrics-spring in a project which uses the maven-shade-plugin, it is necessary to configure several resource transformers to instruct shade on how to merge resources.

Without this Spring will not work correctly and reporters will not be detected.

Sample shade plugin configuration:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-shade-plugin</artifactId>
	<version>2.1</version>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>shade</goal>
			</goals>
			<configuration>
				<transformers>
					<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
						<resource>META-INF/spring.handlers</resource>
					</transformer>
					<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
						<resource>META-INF/spring.schemas</resource>
					</transformer>
					<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
				</transformers>
			</configuration>
		</execution>
	</executions>
</plugin>