Uploading war to artifactory fails

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Uploading war to artifactory fails

ettoregia
This post was updated on .
Hello All,

as this is my first post, I'd like to thank you all in advance and for all the previous posts that already helped me a lot.

So here my question, I'm trying to upload a .war file to artifactory (Artifactory 3.4.2 (rev. 30140)) with Gradle 2.2.1, but once I run the task "gradle --debug --stacktrace publishWebAppPublicationToRemoteArtifactoryRepository" everything goes fine up to the uploading process.

See the error I'm getting:
-------------------------------------------------------------------------------------------------------------
00:00:23.371 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] Deploying to http://artifactory:8081/artifactory/libs-release-local
00:00:23.471 [ERROR] [system.err] Uploading: com/mykong/common/controller/SpringMVC/1.0/SpringMVC-1.0.war to repository remote at http://artifactory:8081/artifactory/libs-release-local
00:00:23.517 [ERROR] [system.err] Transferring 4713K from remote
00:00:25.904 [DEBUG] [sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@66fa3d076 pairs: {PUT /artifactory/libs-release-local/com/mykong/common/controller/SpringMVC/1.0/SpringMVC-1.0.war HTTP/1.1: null}{User-Agent: maven-artifact/3.0.4 (Java 1.7.0_71; Linux 3.17.6-300.fc21.x86_64)}{Host: 54.44.55.111:8081}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}{Content-Length: 4825782}  
-------------------------------------------------------------------------------------------------------------

I've the impression that gradle can't find the .war file, though the war was successfully generated at "/SpringMVC/build/tmp/publishWebAppPublicationToRemoteArtifactoryRepository/com/mykong/common/controller/SpringMVC/1.0/SpringMVC-1.0.war"

Any ideas?

Please see below my build.gradle. Also good to know is that I managed to upload the a jar file for the same application, just the war is giving pain.



-------------------------------------------------------------------------------------------------------------------
plugins {
    id 'java'
    id 'osgi'
    id 'maven-publish'
    id 'com.jfrog.artifactory' version '3.0.1'
        id "fr.javatic.jboss-controller" version "1.3"
        id 'war'
}

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
   
    compile group : 'org.springframework', name : 'spring', version: '2.5.6'
    compile group : 'org.springframework', name : 'spring-webmvc', version: '2.5.6'
    compile group : 'javax.servlet', name : 'jstl', version: '1.1.2'
    compile group : 'taglibs', name : 'standard', version: '1.1.2'
    compile group : 'javax.servlet', name : 'servlet-api', version: '2.5'
   
    testCompile group: 'junit', name: 'junit', version: '4.11'
   
}

group = 'com.mykong.common.controller'
version = '1.0'

//This is to deploy a war from the FS to JBsoo EAP
task deployMyWebapp(dependsOn: 'war', type: JBossURLDeployTask) {

    host = "<remoteIPAddress>"
    port = 9999

    username = "admin"
    password = "welcome1-"

    url = new URL("file:///u01/software/ws7/SpringMVC/target/SpringMVC.war")
}


artifactory {
    contextUrl = "${artifactory_contextUrl_Arqiva_Dev}"
    publish {
        repository {
            repoKey = 'libs-release-local'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true
        }
        /*defaults {
            publications ('mavenJava')
        }*/
    }

    resolve {
        repository {
            repoKey = 'libs-release'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true

        }
    }
}


publishing {
    publications {
        webApp(MavenPublication){
            artifactId 'SpringMVC'
            from components.web
        }
       
    }
   
    repositories {
        maven {
            name 'remoteArtifactory'
            url "${fullRepoUrl}"

            credentials {
                username = "admin"
                password = "welcome1-"
            }
        }
    }
}
-------------------------------------------------------------------------------------------------------------------


Hope that makes sense.

Thanks in advance,
Ettore.
Loading...