An open API service indexing awesome lists of open source software.

https://github.com/bytemechanics/copysource-maven-plugin

Maven plugin to copy certain java sources into generated sources in order to reduce undesired dependencies
https://github.com/bytemechanics/copysource-maven-plugin

copy java maven plugin repackage

Last synced: about 2 months ago
JSON representation

Maven plugin to copy certain java sources into generated sources in order to reduce undesired dependencies

Awesome Lists containing this project

README

          

# Copy Sources maven plugin
[![Latest version](https://maven-badges.herokuapp.com/maven-central/org.bytemechanics.maven/copysource-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.bytemechanics.maven/copysource-maven-plugin/badge.svg)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=org.bytemechanics.maven%3Acopysource-maven-plugin&metric=alert_status)](https://sonarcloud.io/dashboard/index/org.bytemechanics.maven%3Acopysource-maven-plugin)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.bytemechanics.maven%3Acopysource-maven-plugin&metric=coverage)](https://sonarcloud.io/dashboard/index/org.bytemechanics.maven%3Acopysource-maven-plugin)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

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**_

## Motivation
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.

## Goals
Available goals:
* copy-classes: Copy classes to generated-sources
* copy-test-classes: Copy classes to generated-test-sources

## Quick start
_**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**_
1. Add the pluguin to your pom
```xml
(...)


(...)

org.bytemechanics.maven
copysource-maven-plugin
X.X.X

(...)


(...)
```
2. Define the execution goal "copy-classes" (the phase it's not necessary, by default uses "generate-sources")
```xml
(...)


(...)

org.bytemechanics.maven
copysource-maven-plugin
X.X.X



copy-classes




(...)


(...)
```
3. Configure it with the copies that you want to do:
```xml
(...)


(...)

org.bytemechanics.maven
copysource-maven-plugin
X.X.X



copy-classes




[source-groupId]:[source-artifactId]:[source-version]

[cannonical-name-of-origin-source. Example:org.bytemechanics.commons.functional.LambdaUnchecker]
(...)

[package-segment-to-replace. Example: org.bytemechanics.commons]
[package-segment-to-replace. Example: org.bytemechanics.standalone.ignite.internal.commons]






(...)


(...)
```

(Please read our [Javadoc](https://copysource-maven-plugin/javadoc/index.html) for further information)