{"id":15045317,"url":"https://github.com/jenkinsci/copyartifact-plugin","last_synced_at":"2025-04-04T06:08:10.163Z","repository":{"id":1231232,"uuid":"1163489","full_name":"jenkinsci/copyartifact-plugin","owner":"jenkinsci","description":"Copy artifacts","archived":false,"fork":false,"pushed_at":"2025-03-01T04:48:44.000Z","size":1851,"stargazers_count":62,"open_issues_count":0,"forks_count":120,"subscribers_count":100,"default_branch":"master","last_synced_at":"2025-03-28T05:13:26.570Z","etag":null,"topics":["adopt-this-plugin","artifact","jenkins-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/copyartifact/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"joearms/adapter_pattern","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-13T05:29:41.000Z","updated_at":"2025-03-01T04:48:47.000Z","dependencies_parsed_at":"2023-02-12T19:01:17.508Z","dependency_job_id":"efe1aefa-b201-48b0-b6f4-1483ffba9818","html_url":"https://github.com/jenkinsci/copyartifact-plugin","commit_stats":{"total_commits":631,"total_committers":56,"mean_commits":"11.267857142857142","dds":0.6434231378763866,"last_synced_commit":"4af972340ee049534832ee6377dc5201a6d05485"},"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fcopyartifact-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fcopyartifact-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fcopyartifact-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fcopyartifact-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/copyartifact-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128751,"owners_count":20888235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adopt-this-plugin","artifact","jenkins-plugin"],"created_at":"2024-09-24T20:51:43.566Z","updated_at":"2025-04-04T06:08:10.144Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Copy Artifact plugin\n\n:sectanchors:\n\nAdds a build step to copy artifacts from another project.\n\nThe plugin lets you specify which build to copy artifacts from (e.g. the\nlast successful/stable build, by build number, or by a build parameter).\nYou can also control the copying process by filtering the files being\ncopied, specifying a destination directory within the target project,\netc. Click the help icon on each field to learn the details, such as\nselecting Maven or multiconfiguration projects or using build\nparameters. You can also copy from the workspace of the latest completed\nbuild of the source project, instead of its artifacts. All artifacts\ncopied are automatically\nlink:https://www.jenkins.io/doc/book/using/fingerprints/[fingerprinted] for\nyou.\n\n#image:docs/images/screenshot-copy-artefacts.png[image]#\n\n:toc:\n\n[[CopyArtifactPlugin-Pipelinesyntax]]\n== Pipeline syntax\n\n* To copy artifacts from the latest stable build of \"sourceproject\"\n+\n[source,groovy]\n----\ncopyArtifacts(projectName: 'sourceproject');\n----\n* To copy artifacts from the specific build of \"downstream\"\n+\n[source,groovy]\n----\ndef built = build('downstream');  // https://plugins.jenkins.io/pipeline-build-step\ncopyArtifacts(projectName: 'downstream', selector: specific(\"${built.number}\"));\n----\n* Parameters of copyArtifacts\n+\n[cols=\",,\",options=\"header\",]\n|===\n|parameter |type |description\n|projectName |string |the name of project (required)\n\n|selector |BuildSelector |the selector to select the build to copy from.\nIf not specified, latest stable build is used.\n\n|parameters |string |comma-separated name and value pairs\n(name1=value1,name2=value2) to filter the build to copy from.\n\n|filter |string |ant-expression to filter artifacts to copy\n\n|excludes |string |ant-expression to exclude artifacts to copy\n\n|target |string |target directory to copy to\n\n|flatten |boolean |ignore directory structures of artifacts\n\n|optional |boolean |do not fail the step even if no appropriate build is\nfound.\n\n|fingerprintArtifacts |boolean |fingerprint artifacts to track builds\nusing those artifacts. false for default if the parameter isn't specified\n(Snippet Generator defaults this to true and specifies the parameter).\n\n|resultVariableSuffix |boolean |useless for pipelines\n|includeBuildNumberInTargetPath |boolean |Include source build number in target path.\n|===\n* selectors\n+\n[cols=\",\",options=\"header\",]\n|===\n|name |feature\n|lastSuccessful |Latest successful build\n|specific |Specific build\n|permalink |Specified by permalink\n|lastCompleted |completed build (ignoring build status)\n|latestSavedBuild |Latest saved build (marked \"keep forever\")\n|buildParameter |Specified by a build parameter\n|upstream |Upstream build that triggered this job\n|===\n\n[[CopyArtifactPlugin-ConfigurationNotes]]\n== Configuration Notes\n\n* When using this plugin with a Windows agent node that is configured as\na Windows service, the service should have permission to interact with\ndesktop (select \"Allow service to interact with desktop\" from Jenkins\nAgent service properties). Otherwise you may see errors similar to this:\n+\n....\nERROR: Failed to copy artifacts from ...\nhudson.util.IOException2: java.lang.IllegalAccessError: class hudson.remoting.Pipe$ConnectCommand cannot\n  access its superclass hudson.remoting.Command\nat hudson.FilePath.copyRecursiveTo(FilePath.java:1526)\nat hudson.FilePath.copyRecursiveTo(FilePath.java:1451)\nat hudson.plugins.copyartifact.FilePathCopyMethod.copyAll(FilePathCopyMethod.java:51)\n...\n....\n\n[[CopyArtifactPlugin-RecommendedusageofCopyartifact]]\n== Recommended usage of copy artifact\n\n* Artifacts should be stored as archived files.\n** Copyartifact tries to copy artifacts preserving file attributes like\npermissions and symbolic links. Though, it may fail in some situations\n(like for security issues).\n** It's highly recommended to pack files to copy into an archive file,\nusing `+tar+` command\nor link:https://jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#zip-create-zip-file[`+zip+`\npipeline step], especially when it's important for you to preserving\nfile attributes or directory structures.\n\n[[CopyArtifactPlugin-Permissionstocopyartifact]]\n== Permissions to copy artifact\n\nNOTE: Since version 1.44, Copy Artifact checks permissions more thoroughly in its default Production mode. If you have permission issues when upgrading from copyartifact 1.43.1 or earlier you can use \u003c\u003cCopyArtifactPlugin-MigrationMode,Migration Mode\u003e\u003e. You should convert to Production mode as soon as possible.\n\nWhen you face a following message and fail to copy artifacts, this may\nbe caused by permission to the job with artifacts. Please read this\nsection once.\n\n....\nUnable to find project for artifact copy: YOUR_PROJECT_WITH_ARTIFACTS\nThis may be due to incorrect project name or permission settings; see help for project name in job configuration.\nBuild step 'Copy artifacts from another project' marked build as failure\n....\n\nYou can configure to allow Copy Artifact to access source jobs in the following ways.\n\n* \u003c\u003cCopyArtifactPlugin-Specifyprojectswhocancopyartifacts,Configure source jobs specifying jobs who can copy artifacts.\u003e\u003e\n* \u003c\u003cCopyArtifactPlugin-Authorizebuildsasauser,Authorize builds as a user.\u003e\u003e\n\nThe message will not be encountered if the \"Authenticated\" user group has the \"job/read\" permission enabled.\nIf this issue appears on your controller, check if this configuration has recently changed.\n\n[[CopyArtifactPlugin-Specifyprojectswhocancopyartifacts]]\n==== Specify projects who can copy artifacts\n\n* In the job configuration pages, you can specify jobs to allow\ncopy artifacts from that project: +\n#image:docs/images/permissions_06_copypermission.png[image]#\n* Use `+copyArtifactPermission+` in pipelines:\n** Declarative pipeline:\n+\n[source,groovy]\n----\npipeline {\n    agent any;\n    options {\n        copyArtifactPermission('job1,job2,...');\n    }\n    stages{...}\n}\n----\n** Scripted pipeline\n+\n[source,groovy]\n----\nproperties([\n    copyArtifactPermission('job1,job2,...'),\n]);\nnode {\n    ...\n}\n----\n* You can specify multiple jobs separated by commas.\n* You can use wildcard character ('*') to specify name patterns.\n\n[[CopyArtifactPlugin-Authorizebuildsasauser]]\n==== Authorize builds as a user\n\n* https://plugins.jenkins.io/authorize-project/[Authorize Project plugin] enables you to run builds of a project as a specific user.\n** Copy Artifact treats builds running as anonymous without authorization configurations.\n* You can resolve permission problems by running builds as a user with read permission to the project with artifacts +\n#image:docs/images/permissions_07_authorizeproject.png[image]#\n\n[[CopyArtifactPlugin-MigrationMode]]\n=== Migration Mode\n\nMigration mode is available and automatically enabled for users upgrading Copy Artifact from 1.43.1 or earlier.\n\nMigration mode performs permission checks when configuring jobs\nor when running builds if the name of the source job is\nconfigured with variables.\nThis is the behavior compatible to Copy Artifact 1.43.1 or earlier.\n\nThis may cause security vulnerabilities allowing malicious users\nto bypass permission checks.\nThis mode is provided only to allow users to upgrade job configurations\nand migrate to Production mode easily. You should migrate to Production mode as soon as you can.\n\nBuild executions that would fail in Production mode are\nrecorded and displayed as warnings to administrators.\n\n#image:docs/images/migrationmode-monitor.png[migration mode warnings]#\n\nAdministrators should check those warnings\nand update the job configurations to successfully use Production mode.\n\n#image:docs/images/migrationmode-helper.png[Migration helper]#\n\n[[CopyArtifactPlugin-Usewithdeclarativepipelines]]\n== Use with declarative pipelines\n\nOne example:\n\n[source,groovy]\n----\nstages {\n    stage('Copy Archive') {\n         steps {\n             script {\n                step ([$class: 'CopyArtifact',\n                    projectName: 'Create_archive',\n                    filter: \"packages/infra*.zip\",\n                    target: 'Infra']);\n            }\n        }\n    }\n...\n}\n----\n\nWhat that is doing:\n\n* Go to the project/workspace named \"Create_archive\".\n* Look in the folder \"packages\" for the file(s) \"infra*.zip\".\n* Copy that file(s) into the folder \"Infra\", in the local workspace.\nFolder will be created if it doesn't already exist.\n\n[[CopyArtifactPlugin-Issues]]\n## Reporting Issues\n\nReport issues in the link:https://www.jenkins.io/participate/report-issue/redirect/#15692[Jenkins issue tracker].\nPlease use the link:https://www.jenkins.io/participate/report-issue/[\"How to Report an Issue\"] guidelines when reporting issues.\n\n* https://issues.jenkins.io/issues/?jql=resolution%20is%20EMPTY%20and%20component%3D15692[Open Issues]\n\n== Release History\n\nChangelogs for current releases are recorded in link:https://github.com/jenkinsci/copyartifact-plugin/releases[GitHub releases]\n\nChangelogs for previous releases are recorded in the link:https://github.com/jenkinsci/copyartifact-plugin/blob/8598cd8c4aa8724680a8e286eb314202249c3049/CHANGELOG.adoc[legacy changelog].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fcopyartifact-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fcopyartifact-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fcopyartifact-plugin/lists"}