Maven plugin to copy certain java sources into generated sources in order to reduce undesired dependencies
This project is maintained by bytemechanics
Maven pluguin to copy and repackage sources to reduce library dependencies
IMPORTANT NOTE: We strongly recommends to use this plugin only for libraries, for final projects if you want to build a uber-jar maven already has it’s shade plugin that works perfectly
To keep the dependency hell away from your projects its important to reduce at minimum the dependencies of each library. But at te same time this can break the code reutilization principle, to avoid this flag the solution comes by copying the source code and repackaging in order to avoid collisions. But this is only necessary when you need ONLY some specific classes, if you need the full library then you should add it as dependency.
Available goals:
IMPORTANT NOTE: We strongly recommends to use this plugin only for libraries, for final projects if you want to build a uber-jar maven already has it’s shade plugin that works perfectly
(...)
<build>
<plugins>
(...)
<plugin>
<groupId>org.bytemechanics.maven</groupId>
<artifactId>copysource-maven-plugin</artifactId>
<version>X.X.X</version>
</plugin>
(...)
</plugins>
</build>
(...)
(...)
<build>
<plugins>
(...)
<plugin>
<groupId>org.bytemechanics.maven</groupId>
<artifactId>copysource-maven-plugin</artifactId>
<version>X.X.X</version>
<executions>
<execution>
<goals>
<goal>copy-classes</goal>
</goals>
</execution>
</executions>
</plugin>
(...)
</plugins>
</build>
(...)
(...)
<build>
<plugins>
(...)
<plugin>
<groupId>org.bytemechanics.maven</groupId>
<artifactId>copysource-maven-plugin</artifactId>
<version>X.X.X</version>
<executions>
<execution>
<goals>
<goal>copy-classes</goal>
</goals>
<configuration>
<copies>
<copy>
<artifact>[source-groupId]:[source-artifactId]:[source-version]</artifact>
<classes>
<class>[cannonical-name-of-origin-source. Example:org.bytemechanics.commons.functional.LambdaUnchecker]</class>
(...)
</classes>
<fromPackage>[package-segment-to-replace. Example: org.bytemechanics.commons]</fromPackage>
<toPackage>[package-segment-to-replace. Example: org.bytemechanics.standalone.ignite.internal.commons]</toPackage>
</copy>
</copies>
</configuration>
</execution>
</executions>
</plugin>
(...)
</plugins>
</build>
(...)
(Please read our Javadoc for further information)