On Feb 9, 2009, at 8:12 AM, mvlcek wrote:
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
The ivy default is 'default' I think. But I agree that our default
should be 'master'. As we define the 'default' configuration that it
extends 'master' and 'runtime', this should work fine. That way you
can say that you are only interested in the artifacts of another
module (by using 'master'), or the artifacts and the dependencies
('default').
- 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.
Definitely.
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?
This is definitely a bug. But we have already changed and improved the
whole publishing stuff in trunk. We have for example thrown out the
artificial libs and dists configuration. But I can't really recommend
to switch to trunk at the moment, as this area is still changing a lot
right now. I hope that 0.6 will be out in two weeks.
Apologies for taking so long to respond.
- Hans
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
--
Hans Dockter
Gradle Project lead
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email