manabreak
manabreak

Reputation: 5597

How to publish a multi-module Gradle project to local Maven repository?

I have a Gradle library project which has multiple modules, somewhat like this:

ModuleA (aka. the main module)
 ^- ModuleB
 ^- ModuleC
     ^- ModuleD

Each of these modules has external dependencies as well. Inside this project, all works fine and dandy. Now, I want to publish this project as a dependency so that I can easily integrate everything to another project (all modules A-D, as well as the external dependencies). However, when I publish to local Maven repository with publishToMavenLocal, only the classes from ModuleA are available in the consumer project.

How do I configure the project so that the consumer project gets to use everything from the library project?

Upvotes: 4

Views: 4444

Answers (1)

Dhaval Gajjar
Dhaval Gajjar

Reputation: 2960

You need to apply the publishing plugin to allprojects instead of root project.

Try Maven - Publishing Multiple Sub-Modules/Artifacts.

Upvotes: 0

Related Questions