ivy module.xml doesn't contain all artifacts when gradle publish is used

谁都会走 提交于 2020-01-17 11:32:46

问题


I believe this may be related to publish artifact overwrite other artifact in Gradle

if I have a set of publications such as

publishing {
  publications {
    serverpub(IvyPublication) {
      artifact(ejbJar) {
        name 'ejb' 
      }
    }
    clientpub(IvyPublication) {
      artifact(clientEjbJar) { 
        name 'client-ejb' 
      }
    }
    modulepub(IvyPublication) {
      artifact(moduleJar) {
        name 'cname-core'
      }
    }
    persistpub(IvyPublication) {
      artifact(persistenceJar) {
        name 'core-entities'
      }
    }
  }
}

After doing a 'publish' the

<Project Name>/ivy/<version>/ivy/ivy-<version>.xml

file only contains the first item in the list of publications

<artifact name="ejb" type="jar" ext="jar"/>

If I make all of the artifacts fall under a single publication ie. serverpub then the ivy.xml file will contain all of the correct artifacts but the jar files themselves are all identical thus I have the same error as the previous link.

Am I doing something wrong because so far Gradle has proved a pain in the parenthesis for publishing artifacts.


回答1:


You have declared four independent publications, each of which will produce its own module descriptor. To produce an Ivy module containing multiple artifacts, you'll have to list them under the same publication. Regarding the "Jar files are identical" problem, a minimal self-contained reproducible example would help.

Note that the new ivy-publish plugin that you are using is still incubating and may have shortcomings. We are grateful for feedback to make it better. The best place to reach Gradle developers and experts is http://forums.gradle.org.



来源:https://stackoverflow.com/questions/16281512/ivy-module-xml-doesnt-contain-all-artifacts-when-gradle-publish-is-used

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!