Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding module name in Gradle build

We just moved from Ant+Ivy builds to Gradle.My project structure is

Project A  which has two sub modules : module1 and module2

Both module1 and module2 have their own build.gradle files.The problem is when I publish an artifact from module1,I want the artifact pattern to be like :

projectA-module1.jar instead of just module1.jar

It was pretty simple to do in Ivy using:

<info organisation="abc" module="projectA-module1">

Is there any way I can change the module name in gradle?

PS: I researched and found out we have group instead of organisation in gradle but not for module name.I am publishing to Artifactory

Thanks.

like image 965
Shweta Avatar asked Oct 25 '25 12:10

Shweta


1 Answers

As I understand, you just want to change the name of the project. It's easy to do in the 'settings.gradle' file. Just set the name of the project to projectA-module1:

rootProject.name = 'projectA-module1'
like image 111
JBaruch Avatar answered Oct 27 '25 00:10

JBaruch