Package a JAR dependency into component JAR

sorry if this is a stupid question for Gradle/Maven gurus, but I’m not among them (my bad).

Is it possible to embed a specific JAR dependency in the deployed artifacts for an application component, instead of having a reference to an online repository?

I ask this because sometimes I’d like to fix some issues in an external library, and use that variation in my component, but without the fuss of publishing that dependency on an online repository.



You can define one extra module in your build.gradle and copy all the sources of library there if the license permits this. Apply java, maven, idea and cuba plugins for this module in Gradle. Thus this library will become one of the add-on modules. See cuba-jm add-on which has one extra cuba-jm-jm module for core / web applications.

1 Like

Thanks, that’s a good compromise.
Having the third-party code compiled as a totally independent project would be better, but at least with this approach I can isolate the third party code in a separate module/compilation unit.

A typical scenario is with vaadin components that I need to fork and change slightly, or to apply some fixes/patches to the old 7 versions, that are unmaintained by their authors (I hope 8 will come sooner than later in CUBA…)

Thx for tip,