title: Archive the artifacts in Jenkins
body: <p>Could someone please explain to me the idea of <strong>artifacts</strong> in the build process?</p>
  
  <p>I have the workspace directory where I check out the code to compile and run my ant scripts etc. At the end, in my case, I get a jar file that's ready to install. Is that considered to be the artifact?</p>
  
  <p>Where should I tell my build script to put the jar file? In the workspace directory? My jar file gets a unique filename depending on variables like <code>BUILD_ID</code> and such, how can I tell Jenkins which jar file to pick?</p>
  
  <p>EDIT:
  Okay, so i tried doing something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/rPNno.png" alt="enter image description here"></p>
  
  <p>The path does not exist yet in my workspace, because the build script is supposed to create it, and of course, the <code>.jar</code> and <code>.properties</code> files are not there because they haven't been generated yet. Why does it give me an error then? Seems like I'm missing something.</p>
  
  <p>Also, does Jenkins delete the artifacts after each build (not the archived artifacts, I know I can tell it to delete those)? Otherwise it will clog the hard drive pretty quickly.</p>