- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想将我的库切换到 Gradle Script Kotlin,但我找不到配置 uploadArchive 任务的方法。
这是我想翻译的 groovy kotlin 脚本:
uploadArchives {
repositories {
mavenDeployer {
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
/* A lot of stuff... */
}
}
}
}
task<Upload>("uploadArchives") {
/* ??? */
}
Upload
任务由
MavenPlugin
“增强” .
最佳答案
0.11.x
(在 Gradle 4.2 中)为具有约定插件的任务添加了更好的支持,并更好地支持重型 Groovy DSL。完整的发行说明位于 GitHub .以下是这些笔记的相关片段:
Better support for Groovy-heavy DSLs (#142, #47, #259). With the introduction of the withGroovyBuilder and
withConvention
utility extensions.withGroovyBuilder
provides a dynamic dispatching DSL with Groovy semantics for better integration with plugins that rely on Groovy builders such as the coremaven
plugin.
plugins {
java
maven
}
group = "org.gradle.kotlin-dsl"
version = "1.0"
tasks {
"uploadArchives"(Upload::class) {
repositories {
withConvention(MavenRepositoryHandlerConvention::class) {
mavenDeployer {
withGroovyBuilder {
"repository"("url" to uri("$buildDir/m2/releases"))
"snapshotRepository"("url" to uri("$buildDir/m2/snapshots"))
}
pom.project {
withGroovyBuilder {
"parent" {
"groupId"("org.gradle")
"artifactId"("kotlin-dsl")
"version"("1.0")
}
"licenses" {
"license" {
"name"("The Apache Software License, Version 2.0")
"url"("http://www.apache.org/licenses/LICENSE-2.0.txt")
"distribution"("repo")
}
}
}
}
}
}
}
}
}
关于gradle-kotlin-dsl - 使用 gradle 脚本 kotlin 配置 uploadArchives 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39497010/
我的 gradle 脚本中有一个上传任务: uploadArchives { repositories { mavenDeployer { reposi
我有我的 uploadArhives 到 Maven 存储库 .aar 发布。 但我必须始终从控制台运行 gradlew uploadArhives,如何编写代码以使其在每次构建或发布构建时调用? u
我创建了一个 gradle 项目,一切正常,但是当我尝试上传到我的 Maven 存储库时,我收到以下 Gradle 错误: FAILURE: Build failed with an exceptio
我正在开发一个带有一组可发布库的仓库,每个库都在一个模块中。这个想法是每个库都应该能够单独发布,即 ./gradlew upload . 目前在每个模块中,我都有以下代码来发布它: uploadArc
我认为uploadArchives是一个由java插件提供的任务。在我的 build.gradle 中,我使用 java 插件: apply plugin: 'java' 但是,如果我在命令行上调用
我有一个包含多种产品口味的应用程序。我使用 maven 插件和 uploadArchives 任务将我的 apk 上传到 nexus,使用这个: https://raw.githubuserconte
我的 build.gradle 中有以下内容: afterEvaluate { project -> uploadArchives { repositories { maven
我只是将我们的 nexus 存储库迁移到新服务器并更新 build.gradle 以指向该服务器。 uploadArchives { repositories.mavenDeployer {
我很困惑为什么 Gradle 的 uploadArchive 会从其他配置上传 Artifact 。我的理解是,当您声明配置时,它将为您获取上传任务,并且在调用时它将上传分配给其配置的 Artifac
我将 gradle 版本更新为 7.0.4 ( com.android.tools.build:gradle:7.0.4 ) 现在在我的一些模块中,我正在解决 problem与 maven 。 所以我
我有一个场景,我需要在 init.gradle 文件中捕获以下详细信息。 我们可以获得任务的所有事件吗? UploadArchive 和发布任务的输入参数,其中 repo 是要上传的工件,所有 GAV
我有一个 build.gradle 文件要在私有(private) Maven 存储库上构建和上传一个 Android 库 (.aar) 脚本工作正常,但问题是,它将我的两个 buildType 上传
我的 gradle.build 文件看起来像这样 apply plugin: 'java-library' apply plugin: 'maven' dependencies { imple
我的 Android 项目刚刚从 Eclipse 和 Maven 切换到 Android Studio 和 Gradle。 现在我希望我的 Jenkins 服务器能够构建发布版本并将其上传到我的自托管
我使用此gradle uploadArchives 将我的一个android 开源库的 Artifact (jar、源代码和javadoc)上传到oss sonatype nexus reposito
我想将我的库切换到 Gradle Script Kotlin,但我找不到配置 uploadArchive 任务的方法。 这是我想翻译的 groovy kotlin 脚本: uploadArchiv
我是一名优秀的程序员,十分优秀!