0
votes

Very new to jenkins so I apologize, getting the following while running my jenkins job:

Now mvn clean install [Pipeline] echo Now Archiving... [Pipeline] archiveArtifacts Error when executing success post condition: hudson.AbortException: No artifacts found that match the file pattern "**/target/*.jar". Configuration error? at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:253) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Archiving artifacts ‘/target/*.jar’ doesn’t match anything: ‘’ exists but not ‘**/target/*.jar’ [Pipeline] }

I'm trying to get it to simply build and find the .jar for now, then I will look into scp to my EC2 for a deployment stage.

Thanks

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

1

1 Answers

0
votes

Have you confirmed if the files actually exists in your workspace after a build occurs??

def fileExists = fileExists '**/target/surefire-reports/TEST-*.xml'

                if (fileExists) {
                    junit fileExists
                } else {
                    echo 'Sorry file does not exist have you skipped test ???'
                }

you can add this if you want in your code, checks if the file exists.

P.S. trying mention the absolute PATH from the workspace and see if that works

Hope it helps :)