简体   繁体   English

我如何在teamcity上发布gradle来发布使用maven插件的gradle构建?

[英]How can i do a gradle publish on teamcity to publish a gradle build that uses the maven plugin?

I have teamcity currently configured to use the maven mojo, to publish the gradle jar as a nexus snapshot with just the gav.我目前已将 teamcity 配置为使用 maven mojo,将 gradle jar 发布为仅带有 gav 的 nexus 快照。

I observe that if i use the maven plugin and do a gradle install in the IDE, i am able to see the generated pom.我观察到,如果我使用 maven 插件并在 IDE 中进行 gradle 安装,我可以看到生成的 pom。

1) Can i use this pom to publish the jar in nexus repo in teamcity ? 1)我可以使用这个pom在teamcity的nexus repo中发布jar吗? I know that i can do it for a pure maven build by using it's pom.我知道我可以通过使用它的 pom.xml 来为纯 maven 构建做到这一点。

2) Is there a way to not use this pom, and istead configure teamcity build steps to publish from gradle build directly ? 2)有没有办法不使用这个pom,而是配置teamcity构建步骤直接从gradle构建发布?

Gradle can of course take care of the publication. Gradle 当然可以负责发布。 It will leverage the build information to produce a POM file that represents best what is declared in your project.它将利用构建信息生成一个 POM 文件,该文件最能代表您项目中声明的内容。

It will then be trivial to invoke that Gradle task from the Teamcity build.然后从 Teamcity 构建中调用该 Gradle 任务将是微不足道的。

Have a look at the publishing documentation for details on how to set it up.有关如何设置的详细信息,请查看 发布文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Maven-Publish Android Gradle Plugin 生成的组件在 Kotlin DSL (build.gradle.kts) 中? - How do you use Maven-Publish Android Gradle Plugin's generated components in Kotlin DSL (build.gradle.kts)? 如何使用 Gradle Publish Plugin 将 proguard JAR 发布为 Maven Artifact - How to publish proguard JAR as Maven Artifact using Gradle Publish Plugin Maven-publish gradle插件会跳过该版本 - Maven-publish gradle plugin skips the version Gradle Maven 发布插件与多个 JDK - Gradle Maven Publish Plugin with Multiple JDK 如何使用maven-publish gradle插件附加AAR文件的源? - How to attach sources of an AAR file with maven-publish gradle plugin? 在gradle多项目中,如何构建单个jar并将其发布到maven? - In gradle multi-project, how to build single jar and publish it to maven? 如何使用 gradle maven-publish 插件和 Kotlin DSL 发布带有空 pom 的 shadow jar? - How to publish a shadow jar with an empty pom using gradle maven-publish plugin and Kotlin DSL? 如何使用shadowJar gradle插件而不是Maven发布将胖JAR发布到JitPack - How to publish a fat JAR to JitPack using shadowJar gradle plugin and not maven publish 如何使用 Gradle 7.0 发布到 Maven 存储库 - How to publish to Maven Repo using Gradle 7.0 如何使用 Gradle 将源代码发布到本地 maven 存储库? - How to publish source into local maven repository with Gradle?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM