When I build and publish my multiplatform library to my maven repo the artifact name that gets created is the name of the module in the project
example:
Copy code
com.tycz:library-android:0.2.0
Where
library
is the module name in the project
I want to change it to something like this
Copy code
com.tycz:myProject-android:0.2.0
How can I change the artifact name?
m
mdabrowski89
02/10/2021, 7:27 AM
try rename the
library
module
j
Joost Klitsie
02/10/2021, 8:46 AM
@mdabrowski89 that sounds like a suboptimal solution
afterEvaluate {
publishing.publications.all {
this as MavenPublication
artifactId = project.name + "-$name".takeUnless { "metadata" in name }.orEmpty()
}
}
Joost Klitsie
02/10/2021, 8:56 AM
I think you can try to replace the
project.name
part with your own name
Joost Klitsie
02/10/2021, 8:56 AM
locally I see that the names in my local repo change
j
Jeff Tycz
02/11/2021, 12:06 AM
While I am able to change the project name with that, it also incorrectly sets the framework name. Now I get