I want to Archive the artifacts of my program, but when the build failes he doesn't save the artifacts. Why is this?
Because I only want to read the artifact when the job failed!
Thanks for your response!
--
Always when the job fails, I didn't get the artifact. I test it in very small jobs:
Empty batch file + artifact a file, Result: Job Succesfull, Artifact: succesfull
Exit 1 in batch file + artifact a file, Result: Job fails, Artifact: didn't do anything
config.xml file of the job:
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers class="vector"/>
<concurrentBuild>false</concurrentBuild>
<customWorkspace>C:\test\</customWorkspace>
<builders>
<hudson.tasks.BatchFile>
<command>exit 1</command>
</hudson.tasks.BatchFile>
</builders>
<publishers>
<hudson.tasks.ArtifactArchiver>
<artifacts>tomcat\logs\tomcat.log</artifacts>
<latestOnly>false</latestOnly>
</hudson.tasks.ArtifactArchiver>
</publishers>
<buildWrappers/>
</project>
Artifacts are archived regardless of whether the build failed or not. Make sure of the following:
Also take a look at this related question.