Is it possible to Install file to local cache in gradle similar to Maven install:install-file?

661 Views Asked by At

Currently I am using maven to install this file to maven local repo and then later in my application gradle build I have the dependency for this artifact.

    mvn install:install-file -Dfile=locallib/wlthint3client.jar -DgeneratePom=true -DgroupId=com.oracle.weblogic -DartifactId=wlthint3client -Dversion=10.3 -Dpackaging=jar

Dependency in build.gradle

    compile("com.oracle.weblogic:wlthint3client:10.3")

Is there way to install the file in to gradle local cache by using gradle ?

Thanks in advance.

-Vidya

1

There are 1 best solutions below

0
On

I got an workaround for this. I am using gradle itself to push it to maven local repo.

Snippet from build.gradle:

configurations {
    resultArchives
}

uploadResultArchives {
    repositories {
        mavenDeployer {
            repository(url: mavenLocal().url)
            pom.version = '10.3'
            pom.artifactId = 'wlthint3client'
            pom.groupId = 'com.oracle.weblogic'
        }
    }
}

artifacts {
    resultArchives file: file('locallib/wlthint3client.jar')
}

To push the artifact to maven local repo:

gradle uploadResultArchives