Prototyping Gradle with our projects I’m facing the following problem concerning the publication of artifacts to our Ivy repository: The default uploadArchives task takes module’s name from the name of the folder the build is executed in - or in Gradle parlance the value from “project.name”. Explicit definition of an archivesBaseName property - like here:
group = 'my-group'
archivesBaseName = 'my-base-name'
does not change that behaviour. Issuing “gradle clean build uploadArchives” within my local workspace’s folder WORKSPACE-DIR produces an ivy.xml containing the following “info” XML element:
First of all this is not intended, I would expect to get the value of “archivesBaseName” property here. The second problem arises if applying some kind of CI server - like Jenkins for instance: Jenkins per default checks out the code to folders called “workspace”; issuing “gradle clean build uploadArchives” there - by hand or by Jenkins - yields this ivy.xml:
There is not currently any way to publish to an ivy repository using a module name different to the project name. We are working on a new ‘ivy-publish’ plugin which will eventually address this, but for now you need to use the workaround described in GRADLE-2344.
I’m guessing it’s the root project you want to rename, so use the following in your settings.xml
Thanks for your help, it works as expected. Well, the comment you pasted more looks like Groovy syntax than XML, so I put it to a file “settings.gradle” instead of “settings.xml”
There is not currently any way to publish to an ivy repository using a module name > different to the project name. We are working on a new ‘ivy-publish’ plugin which will
eventually address this, …
Daz, is this already addressed in the ‘ivy-publish’ plugin or the workaround is still valid?
So close! Gradle 1.7 will contain the ability to customise the coordinates of an IvyPublication using the ‘ivy-publish’ plugin. Expect to see ‘gradle-1.7-RC1’ some time next week, or you can use a nightly build.
I have a similar problem. I’m able to set the module name with Gradle 1.7 just fine but I couldn’t figure out a “clean” way to set the artifact name. Basically I want the artifact name to match the archivesBaseName rather than the module name (which I think it is defaulting). The following works but is really ugly. There’s got to be a better way.