Hello,
I have a problem with deploying multiple artifacts to maven from a single
build.gradle. I have the following artifacts produced:
jar {
}
task sourcesJar {
..
classifier='sources'
}
task testsJar(type: Jar) {
appendix='tests'
}
task testSourcesJar(type: Jar) {
appendix='tests'
classifier='sources'
}
task someTar(type: Tar) {
baseName = 'pack'
}
So, three main artifact, two of them has a source attachment. I've added
filter's accordingly to the documentation. Also I've added beforeDeployment
closure to print out deployment contents. I'm getting it all correct.
However, attachment artifacts are uploaded incorrectly. In general the
following happens (accordingly to the debug log):
1) jar is uploaded
2) jar-sources is uploaded
3) testsJar is uploaded
4) jar-sources is uploaded (with the name testJar-sources)
5) testsJar-source is uploaded (overwriting those uploaded in point 4)
6) pack is uploaded
7) jar-sources is uploaded (with the name pack-sources)
8) testsJar-source is uploaded (overwriting those uploaded in point 7)
As a result pack always has some attachment in repository (which it should
not have!) and plus there are uploads that should not be. It looks like once
processed and uploaded, attachment artifact is then always attached to the
subsequent deployments.
So far, I can't find a workaround for that. I tried to exclude attachments
in filters and to add them conditionally in beforeDeployment block, but the
problem persist - being added once in beforeDeployment block attachment is
then uploaded in all subsequent deployments (despite not being listed in
deployment). So it might be an ivy problem, not a gradle one (there are
wrong attachment in the local maven repository).
Another workaround I didn't tried yet is to use multiple uploadXXX tasks,
but this I'd like to avoid, because I'm configuring uploadMaven task in my
Gradle plugin (it adds credentials there and sets custom local maven
repository location, see below on that).
Another issue with maven deployment is that there is no way to configure
location of the local maven repository for mavenDeployer. It always uses
~/.m2 path. To work this around I had to provide my own
CustomDeployTaskFactory where I set custom location of the local maven
repository.
I'm in half way setting up gradle builds for our projects and so far it is
constant struggle with the Gradle issues. The only excuse for Gradle is that
all other options are worse! :) When I finish with the gradelizing of our
builds, I'll publish a list of problems and issues I've encountered and the
workarounds I've used.
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Issues-with-deploying-multiple-artifacts-to-maven-tp4341354p4341354.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email