How to change the jar filename when upload to artifactory via gradle

后端 未结 1 877
走了就别回头了
走了就别回头了 2021-01-15 02:49

I am using gradle in order to upload jar to artifactory. I managed to do it however I am trying to change the jar filename but it doesnt really let me.

I am using sh

相关标签:
1条回答
  • 2021-01-15 03:32

    The Jar task default naming convention is

    [baseName]-[appendix]-[version]-[classifier].[extension]
    

    If you set just the basename, the remaining values get appended to it. To override, set archiveName instead of baseName

    shadowJar {
        ...
        archiveName = 'com.mycompany.app-all'
        ...
    }
    

    To change naming on what artifactory is publishing:

    publishing {
        publications {
            mavenJava(MavenPublication) {
                from components.shadow
    
                groupId 'com.mycompany'
                artifactId 'com.mycompany.app-all' //<-- changed here
                version ''                         // and here
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题