- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近从 Maven 切换到 Gradle。到目前为止,我的 Jenkins 声明性管道包括一个阶段,我们生成打包的 Artifact 并将其发布到 Nexus:
pipeline {
...
stages {
stage ('Build Stage') {
steps {
...
sh "mvn clean deploy"
...
}
}
nexusPublisher nexusInstanceId: 'localNexus', nexusRepositoryId: 'releases', packages: [[$class: 'MavenPackage', mavenAssetList: [[classifier: '', extension: '', filePath: 'buildmavenCoordinate: [artifactId: 'myproject'/lib/myproject-1.0.0.jar']], , groupId: 'com.codependent.myproject', packaging: 'jar', version: '1.0.0']]]
def pom = readMavenPom file: 'pom.xml'
...
nexusPublisher ... mavenCoordinate: [artifactId: pom.artifactId
...
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
group = 'com.codependent.myproject'
version = '1.0.0'
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart',
'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
test {
systemProperties 'property': 'value'
}
...
最佳答案
您在管道中使用 Groovy 吗? Gradle 不提供解析 POM 文件的原生支持。我建议您在 Groovy 中使用 XmlSlurper。
如果您的管道在 Groovy 中,您可以使用 Gradle 使用以下代码读取这些属性:
def pom = new XmlSlurper().parse(new File('pom.xml'))
def version = pom.version
def artifactId = pom.artifactId
def groupId = pom.groupId
println 'my pom version ' + pom.version
println 'my pom version ' + pom.artifactId
println 'my pom version ' + pom.groupId
关于maven - Jenkins 管道和 Gradle 项目,如何获取 GAV 属性以使用 Jenkins Nexus 插件部署 Artifact ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46595489/
我需要知道ApplicationContext属于哪个JAR,同时它的maven gav(我想要它在一些spring jar中)。是否有任何通用的方法来搜索特定类所属的 Jar。我找到http://w
有时人们会说maven GAV,或者在GAV,或者maven repository 中的GAV artifact。maven 上下文中的 GAV 是什么意思? 最佳答案 “存储库使用一组坐标存储 Ar
对于给定的groupId、artifactId、版本、分类器和类型,如何使用REST下载相应的artifact? 最佳答案 使用 gavc 搜索获取 URL,然后您可以从那里下载 Artifactor
我需要从大量 pom.xml 文件中提取 Maven GAV(groupId、artifactId、version)。并非所有 POM 都有父 POM 声明,因此需要考虑父 GAV 和项目 GAV 之
是否有 Jenkins 插件可以对我的 Nexus 存储库进行组 Artifact 版本 (GAV) 搜索并列出结果?我希望结果在参数化构建中作为一个选项(下拉列表)可用。 最佳答案 我在 Dynam
我最近从 Maven 切换到 Gradle。到目前为止,我的 Jenkins 声明性管道包括一个阶段,我们生成打包的 Artifact 并将其发布到 Nexus: pipeline { .
我是一名优秀的程序员,十分优秀!