Ok, tried it out.

Now it's not crashing anymore but isn't producing the desired output anyway:

Uploading: 
de/huxhorn/gradle/de.huxhorn.gradle.pgp-plugin/0.0.2/de.huxhorn.gradle.pgp-plugin-0.0.2.jar
 to repository remote at file:/Users/jhuxhorn/local-gradle-repository/release/
Uploading: 
de/huxhorn/gradle/de.huxhorn.gradle.pgp-plugin/0.0.2/de.huxhorn.gradle.pgp-plugin-0.0.2-source.jar
 to repository remote at file:/Users/jhuxhorn/local-gradle-repository/release/
Uploading: 
de/huxhorn/gradle/de.huxhorn.gradle.pgp-plugin/0.0.2/de.huxhorn.gradle.pgp-plugin-0.0.2.asc
 to repository remote at file:/Users/jhuxhorn/local-gradle-repository/release/
Uploading: 
de/huxhorn/gradle/de.huxhorn.gradle.pgp-plugin/0.0.2/de.huxhorn.gradle.pgp-plugin-0.0.2-javadoc.jar
 to repository remote at file:/Users/jhuxhorn/local-gradle-repository/release/
Uploading: 
de/huxhorn/gradle/de.huxhorn.gradle.pgp-plugin/0.0.2/de.huxhorn.gradle.pgp-plugin-0.0.2.asc
 to repository remote at file:/Users/jhuxhorn/local-gradle-repository/release/
Uploading: 
de/huxhorn/gradle/de.huxhorn.gradle.pgp-plugin/0.0.2/de.huxhorn.gradle.pgp-plugin-0.0.2.asc
 to repository remote at file:/Users/jhuxhorn/local-gradle-repository/release/

15:56:04.812 [DEBUG] [org.gradle.api.Task] Added artifact: 
DefaultPublishArtifact 
de.huxhorn.gradle.pgp-plugin-0.0.2-javadoc.jar:asc:asc:null
15:56:04.947 [DEBUG] [org.gradle.api.Task] Added artifact: 
DefaultPublishArtifact 
de.huxhorn.gradle.pgp-plugin-0.0.2-source.jar:asc:asc:null
15:56:05.052 [DEBUG] [org.gradle.api.Task] Added artifact: 
DefaultPublishArtifact de.huxhorn.gradle.pgp-plugin-0.0.2.jar:asc:asc:null
15:56:05.052 [INFO] [org.gradle.api.Task] Created signature files 
'[/Users/jhuxhorn/Documents/Projects/huxi/huxi-gradle-plugins/pgp-gradle-plugin/build/libs/de.huxhorn.gradle.pgp-plugin-0.0.2-javadoc.jar.asc,
 
/Users/jhuxhorn/Documents/Projects/huxi/huxi-gradle-plugins/pgp-gradle-plugin/build/libs/de.huxhorn.gradle.pgp-plugin-0.0.2-source.jar.asc,
 
/Users/jhuxhorn/Documents/Projects/huxi/huxi-gradle-plugins/pgp-gradle-plugin/build/libs/de.huxhorn.gradle.pgp-plugin-0.0.2.jar.asc]'...

This means that the name of the artifact is somehow overwritten. I create the 
DefaultPublishArtifact with name argument of 
'de.huxhorn.gradle.pgp-plugin-0.0.2.jar' or 
'de.huxhorn.gradle.pgp-plugin-0.0.2-source.jar', i.e. the original filename of 
the file the is signed.

I create the artifact like this:
File file = originalFileWithDataThatWasSigned
File f = fileContainingTheSignature
def extension=f.name
extension = extension.substring(extension.lastIndexOf('.')+1)
DefaultPublishArtifact artifact = new DefaultPublishArtifact(file.name, 
extension, extension, null, new Date(), f, this)

Did I misunderstand anything? DefaultPublishArtifact (or deployer) seems to 
perform some magic transformation on the filename and all manually added files 
end up as
de/huxhorn/gradle/de.huxhorn.gradle.pgp-plugin/0.0.2/de.huxhorn.gradle.pgp-plugin-0.0.2.asc
They are missing the original .jar and also got the already contained 
classifier removed.

Cheers,
Joern.

On 03.11.2010, at 08:53, Adam Murdoch wrote:

> 
> On 01/11/2010, at 10:14 AM, Joern Huxhorn wrote:
> 
>> Hi again.
>> 
>> I tried to use DefaultPluginArtifact to add additional files to the set of 
>> files that will be uploaded during uploadArchives.
>> 
>> Without giving a classifier this results in
>> org.gradle.api.GradleException: Could not publish configurations 
>> [configuration ':pgp-gradle-plugin:archives'].
>> org.gradle.api.InvalidUserDataException: A pom can't have multiple main 
>> artifacts. Already assigned artifact: 
>> de.huxhorn.gradle#pgp-gradle-plugin;0.0.2!de.huxhorn.gradle.pgp-plugin.jar 
>> Artifact trying to assign: 
>> de.huxhorn.gradle#pgp-gradle-plugin;0.0.2!de.huxhorn.gradle.pgp-plugin-0.0.2-javadoc.jar.asc
> 
> I've fixed this now in the master branch. Could you try this out with a new 
> snapshot of Gradle?
> 
> 
> --
> Adam Murdoch
> Gradle Developer
> http://www.gradle.org
> CTO, Gradle Inc. - Gradle Training, Support, Consulting
> http://www.gradle.biz
> 

Reply via email to