【问题标题】:Navigating to .jar via sh通过 sh 导航到 .jar
【发布时间】:2018-08-08 22:40:44
【问题描述】:

对 jenkins 非常陌生,所以我很抱歉,在运行我的 jenkins 工作时得到以下信息:

现在 mvn 全新安装 [管道] echo 正在存档... [管道] archiveArtifacts 执行成功发布条件时出错: hudson.AbortException:未找到与文件模式匹配的工件 “**/目标/*.jar”。配置错误?在 hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:253) 在 org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80) 在 org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67) 在 org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50) 在 hudson.security.ACL.impersonate(ACL.java:290) 在 org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47) 在 java.util.concurrent.Executors$RunnableAdapter.call(未知 源)在 java.util.concurrent.FutureTask.run(未知源)在 java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)在 java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(未知来源)

存档工件“/target/*.jar”不匹配任何内容:“” 存在但不存在'**/target/*.jar' [管道] }

我现在正在尝试让它简单地构建并找到 .jar,然后我将查看 scp 到我的 EC2 以进行部署阶段。

谢谢

Git:https://github.com/BillyCharter87/Tech-O-Dex-API/blob/master/Jenkinsfile

【问题讨论】:

    标签: jenkins


    【解决方案1】:

    您是否确认在构建发生后文件是否确实存在于您的工作区中??

    def fileExists = fileExists '**/target/surefire-reports/TEST-*.xml'
    
                    if (fileExists) {
                        junit fileExists
                    } else {
                        echo 'Sorry file does not exist have you skipped test ???'
                    }
    

    您可以根据需要在代码中添加它,检查文件是否存在。

    附注尝试从工作区中提及绝对路径,看看是否可行

    希望对你有帮助:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-12
      • 2013-05-13
      • 2014-04-05
      • 2011-10-12
      相关资源
      最近更新 更多