How can I use uploadArchives without the Java plugin?


(Blaine Simpson) #1

I have ported HyperSQL to Gradle, using ant.importBuild, and a TON of customization because the nested Ant build files are so complex. I’d very much like to use the maven plugin, but I have searched and searched and I haven’t found a clue about how or if I can specify the jar files to be published unless I use the Java plugin… which I can’t use.

(Actually, the user guide page for the Maven plugin says something like, with configuration work one can do it without the Java plugin, but no hint about how to do that).

I believe that uploadArchives uploads whatever’s in the archives configuration, but when I try to reverse-engineer with a working project of mine that does uploadArchives with the Java plugin, even after a successful uploadArchives, configurations.archives.allDependencies.size() is still 0. ? … and I don’t even know if it’s possible to manually add literal , local files (build through Ant targets) somehow to a Configuration.


(Szczepan Faber) #2

I’m assuming that you would like to use the Upload task without the java plugin?

That would be something like:

configurations {
  someConf
}
  someJar(type: Jar) {
  //more stuff
}
  artifacts {
  someConf someJar
}
  task myUpload(type: Upload) {
  configuration = someConf
  uploadDescriptor = true
      repositories {
    //where to upload, etc.
  }
}

Hope that helps!