On 30/08/2011, at 2:00 AM, Brett Cave wrote:

> On Mon, Aug 29, 2011 at 11:49 AM, davide.cavestro 
> <[email protected]> wrote:
>> Hi guys,
>> I used *jar.enabled = true* on a web application project that uses the war
>> plugin. I want to produce a jar archive for project java code, but I've not
>> yet found a way to publish the jar (unless obviously splitting the project
>> into two sub-projects).
>> I'd like to publish on install on local maven cache at least the jar (better
>> if both), but when I add the jar to the /archives/ closure this way
>> 
>> the build fails complaining /org.gradle.api.InvalidUserDataException: A POM
>> can not have multiple main artifacts. Already have MavenArtifact
>> coreapp:war:war:null, trying to add MavenArtifact coreapp:jar:jar:null/.
> 
> Perhaps a combination of using maven pom customization with filters in the 
> upload task - see http://gradle.org/maven_plugin.html -> "Generation of 
> multiple poms" would work for you.

Brett's right in that you need to use filters to generate poms for both the jar 
and war artifacts.

You'll probably also want to configure this for the install task. The following 
thread has some info on this:

http://gradle.1045684.n5.nabble.com/Depending-on-both-quot-main-quot-and-quot-tests-quot-classifiers-td4576114.html#a4579157

Particularly towards the end (last 3 or so messages).

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to