lzprgmr
(Baiyan Huang)
November 10, 2013, 3:05am
1
Hi, All,
When using ivy-publish, I can publish artifact from components.java, as below:
publications {
ivyJava(IvyPublication) {
from components.java
}
}
And it is possible to change the artifact name by setting module:
publications {
ivyJava(IvyPublication) {
module = "modulename"
from components.java
}
}
But this not only set the final artifact name, but also the module name in ivy file, which I don’t expect - is there a way just for me to configure the artifact name that from components.java when publish?
1 Like
daz
November 10, 2013, 9:47pm
2
You can access and modify the configured artifacts using ‘IvyPublication.getArtifacts()’ which provides an IvyArtifactSet .
publications {
ivyJava(IvyPublication) {
from components.java
artifacts.matching({
it.name == ‘original-name’
}).all({
it.name = ‘new-name’
}) }}
daz
November 10, 2013, 9:47pm
3
You can access and modify the configured artifacts using ‘IvyPublication.getArtifacts()’ which provides an IvyArtifactSet .
publications {
ivyJava(IvyPublication) {
from components.java
artifacts.matching({
it.name == ‘original-name’
}).all({
it.name = ‘new-name’
}) }}
daz
November 10, 2013, 9:48pm
4
You can access and modify the configured artifacts using ‘IvyPublication.getArtifacts()’ which provides an IvyArtifactSet .
publications {
ivyJava(IvyPublication) {
from components.java
artifacts.matching({
it.name == ‘original-name’
}).all({
it.name = ‘new-name’
}) }}
lzprgmr
(Baiyan Huang)
November 11, 2013, 8:13am
5
Thanks Daz, this worked for me, here is what I used to be more accurate:
artifacts.matching({
it.name == project.name &&
it.type == 'jar' &&
it.classifier == null
}).all ({
it.name = "new-name"
})
1 Like