On 07/10/2011, at 6:36 AM, pranav wrote:
> I am not sure if this is answered earlier, but I am having tough time in
> uploading all the artifacts for a projects. I build a poject and create 2
> jars and I want to upload them to artifactory. It just upload the first jar.
> Please help.
>
> This is my gradle.build -
>
> apply plugin: 'java'
> apply plugin: 'maven'
>
> sourceSets {
> main {
> java {
> srcDir 'src/main'
> }
> }
> test {
> java {
> srcDir 'src/test'
> }
> }
> }
>
> version = "1.1.3"
> group = "com.pg"
>
> repositories {
> mavenRepo name: 'myLocal', urls:
> "http://localhost:8080/artifactory/myLocal"
> }
>
> dependencies {
> compile group: 'log4j', name: 'log4j', version: '1.2.15'
> <<<<<< SOME MORE DEPENDENCIES >>>>>>
> testCompile group: 'junit', name: 'junit', version: '4.9'
> }
>
>
> task pgTechJar (type: Jar) {
> baseName = 'pgTech'
> archiveName = 'pgtech.jar'
> from sourceSets.main.classes
> excludes = ['**/terracotta/**']
> }
>
> task dsoJar(type: Jar) {
> baseName = 'dso'
> archiveName = 'pg-dso.jar'
> from sourceSets.main.classes
> includes = ['**/terracotta/**']
> }
>
> artifacts {
> archives pgTechJar, dsoJar
> }
>
> uploadArchives {
> repositories.mavenDeployer {
> repository(url: "http://localhost:8080/artifactory/pg-local") {
> authentication(userName: "admin", password: "password")
> }
> addFilter('pgTechJar') {artifact, file ->
> artifact.name == 'pgTech'
> }
> addFilter('dsoJar') {artifact, file ->
> artifact.name == 'pgDso'
> }
> }
> }
>
> It only uploads pgTechJar and does not upload pgDso.
The artifact name for the dso jar is just “dso”, and you are looking for
“pdDso” in your pom filter.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email