default_avatar
default_avatar

Reputation: 303

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

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.

Upvotes: 0

Views: 304

Answers (1)

Peter Niederwieser
Peter Niederwieser

Reputation: 123910

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.

Upvotes: 0

Related Questions