0

目前我正在使用 maven 将此文件安装到 maven 本地 repo,然后在我的应用程序 gradle 构建中,我有这个工件的依赖项。

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

build.gradle 中的依赖

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

有没有办法使用 gradle 将文件安装到 gradle 本地缓存中?

提前致谢。

-维迪亚

4

1 回答 1

0

我有一个解决方法。我正在使用 gradle 本身将其推送到 maven 本地仓库。

来自 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')
}

要将工件推送到 Maven 本地仓库:

gradle uploadResultArchives
于 2018-02-06T04:47:24.670 回答