Archive Artifacts

Archived artifacts can be downloaded manually and then deployed. By default, build artifacts are kept as long as the build log is.

If you want a job's builds to archive artifacts, you can do so as an after build action:

  1. Open the job’s configuration page.

  2. Click Configure Configure.

  3. Click the After Build tab.

  4. Click Add After Build Action and select Artifact Archiver.

  5. In Files to archive, enter a comma-separated list of file paths, such as env/,SQL/,target/, using the path relative to the workspace, not the full file path.

    You can use wildcards to archive multiple files. For example, you could use env/** to archive all files in all subdirectories of the env directory. Or, you could use env/**/*.bin to archive all files that end with the .bin extension in all subdirectories of the env directory.

    Here are some more examples:

    • **/* or ** archives all files in all directories and subdirectories
    • **/*.sql archives all files that have a .sql file extension, in all directories and subdirectories
    • env/* matches all files in the env folder itself, but doesn't include any files in any subdirectories

    The patterns can be more complex too. For example, you could use **/target/*.jar to archive .jar files in all target directories your workspace.

  6. In Files to exclude, enter a comma-separated list of files, including the path, as described in the previous step.

    A file that matches the exclude pattern won’t be archived even if it matches the pattern specified in Files to archive.

  7. If your application is a Maven application and you want to archive Maven artifacts, select Archive Maven Artifacts.

    To archive the Maven POM file along with the Maven artifacts, select Include POM.xml.

  8. Click Save.