如何使用 rtMaven.deployer.deployArtifacts 添加图案

How to add patterns with rtMaven.deployer.deployArtifacts

我在 Jenkins 管道中使用如下

def buildInfo = rtMaven.run pom: 'src/bwceapp.parent/pom.xml', goals: 'clean 
package initialize'

但这会构建很多工件,我只想使用模式进行部署,即仅 EAR,

rtMaven.deployer.deployArtifacts buildInfo 正在部署 EAR 以及许多其他工件,例如依赖项 jar 等。

我在文档中找不到如何在我的方法中使用模式,非常感谢任何帮助。

试过了,rtMaven.deployer.deployArtifacts buildInfo.addInclude("*.ear"),但没有用。

这也行不通

rtMaven.deployer.artifactDeploymentPatterns.addInclude("*.ear") buildInfo

我能够让它按如下方式工作。

rtMaven.deployer.artifactDeploymentPatterns.addInclude("*.ear")

def buildInfo = rtMaven.run pom: 'src/bwceapp/pom.xml', goals: 'clean package initialize'

rtMaven.deployer.deployArtifacts  buildInfo