我想将自定义gradle包装器上传到artifactory。 我试过了:
我总是有一些像/group/name/revision/[name]-[revision].zip这样的布局
我需要的是简单的repo/name-revision.zip
,就像在gradle-distribution存储库中一样:https://services.gradle.org/distributions
我正在尝试使用'Gradle'布局将zip上传到gradle-local pregenerated artifactory repo
我读过有关常春藤布局等的内容,但对于这么简单的任务来说,这一切看起来都很复杂。
有什么建议吗?
答案 0 :(得分:0)
使用gradle-3.1这对我有用:
gradle.properties
artifactory = http://yourserver/artifactory/reponame
artifactoryUser = username
artifactoryPassword = the-encryped-password
build.gradle
apply plugin: 'maven'
apply plugin: 'distribution'
group = 'foo.bar'
version = '0.5-SNAPSHOT'
// not needed since we have standard layout src/main/dist
// distributions { main { contents { from { ... } } } }
uploadArchives {
repositories {
mavenDeployer {
repository(url: artifactory) {
authentication(userName: artifactoryUser, password: artifactoryPassword)
}
snapshotRepository(url: artifactory) {
authentication(userName: artifactoryUser, password: artifactoryPassword)
}
}
}
}
$> tree src
src
└── main
└── dist
├── bla.txt
└── blub.txt
$> ./gradlew uploadArchives
:distTar
:distZip
:uploadArchives
BUILD SUCCESSFUL
Total time: 1.332 secs
然后可以在神器中找到拉链