Currently all published artifacts are published in the configuration libs.
However, this is not sufficient.

At least the following cases need to be supported:
- publish a (library) jar like apache-axis: It should be published in
configuration "master" (ivy default), as this guarantees that all (runtime)
dependencies are resolved, when used in another project
- publish a war: This has (normally) no dependencies and can be published in
configuration "libs"
- publish a client jar, like the webservice client of an application
providing a webservice: This jar only has a part of the compile time
dependencies of the project or even totally different dependencies specified
in a separate configuration, e.g. "client". Thus this client jar must be
published in exactly this configuration.

As described in the previous post, the configurations property of the jar
task can to be used to change the configuration of the published artifact,
however, currently it prevents the jar from being published.

Should I report a bug?



mvlcek wrote:
> 
> I'm using the war-Plugin to create a web application.
> As this application provides a webservice, I also build a jar with the
> client classes.
> 
> dependencies {
>     ...
>     addConfiguration 'client'
>     client 'org.codehaus.jra:jra:1.0-alpha-4'
>     ...
> }
> ...
> createTask('clientCompile', type:Compile, dependsOn:resources).configure {
>     project.dependencies.linkConfWithTask 'client', name
>     ...
> }
> ...
> libs {
>     jar(baseName: "${project.name}-client") {
>         dependsOn = [ 'clientCompile' ]
>         fileSet(dir: new File(buildDir, clientClassesDirName))
>     }
> }
> 
> This works, however, the jar is published with the configuration libs
> instead of client. Published ivy.xml:
>     <artifact name="...-client" type="jar" ext="jar" conf="libs"/>
>     ...
>     <dependency org="org.codehaus.jra" name="jra" rev="1.0-alpha-4"
> conf="client->default"/>
> 
> If, on the other hand, I specify in the jar-Task:
>     configurations = [ 'client' ]
> 
> then the ivy.xml is correct:
>     <artifact name="...-client" type="jar" ext="jar" conf="client"/>
> 
> however, the jar-File is NOT copied to the repository!
> Bug or feature?
> 

-- 
View this message in context: 
http://www.nabble.com/Publishing-an-artifact-with-a-specific-configuration-tp21874960p21907973.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


Reply via email to