# Archive artifacts stage deprecated in newer jenkins version

**URL:** <https://community.jenkins.io/t/archive-artifacts-stage-deprecated-in-newer-jenkins-version/6436>\
**Category:** Using Jenkins\
**Created:** [March 23, 2023, 9:32am UTC](https://community.jenkins.io/t/archive-artifacts-stage-deprecated-in-newer-jenkins-version/6436 "2023-03-23T09:32:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vysyaraju](https://avatars.discourse-cdn.com/v4/letter/v/90ced4/32.png) [@vysyaraju](https://community.jenkins.io/u/vysyaraju)\
**Post date:** [March 23, 2023, 9:32am UTC](https://community.jenkins.io/t/archive-artifacts-stage-deprecated-in-newer-jenkins-version/6436/1 "2023-03-23T09:32:27Z")

</div>

Hello Team,

Iam using 2.289.1 jenkins version and the pipeline is failing at archive stage and in our groovy file step is like below:-

stage(‘Archive’) {  
def archiveString = componentObject.RetrieveArchiveString()  
if(!archiveString) {  
archiveString = ‘Components\’ + componentId + ‘\Applicatio\bin\x86\Releas\’ + componentId + ‘.dll, Components\’ + componentId + ‘\html\ **\*, \*.xml, Components\’ + componentId + '\CoveragReport\** \_, Component\’ + component + '\NDependOut\*\*\_, Component\’ + component + ‘\.sonarqube\*\*\*’  
}  
nunit testResultsPattern: ‘TestResult.xml’  
step([$class: ‘WarningsPublishe’, canComputeNew: false, canResolveRelativePath: false, defaultEncoding: ‘’, excludePattern: ‘’, healthy: ‘10’, includePattern: ‘’, messagesPattern: ‘’, parserConfiguration: [[parserName: ‘FxCop’, pattern: ‘fxcop-result.xml’]], unHealthy: ‘999’])  
archive archiveString  
}

Can anyone please suggest me what changes i need to do in “archive” stage?

I checked in google that we need to below command but iam not sure how to add the command to my archive stage step

```auto
archiveArtifacts artifacts: 'screenshots/**,build/test/results/*.xml', allowEmptyArchive: true

```

---

<div class="post-metadata">

**Author:** ![vysyaraju](https://avatars.discourse-cdn.com/v4/letter/v/90ced4/32.png) [@vysyaraju](https://community.jenkins.io/u/vysyaraju)\
**Post date:** [March 24, 2023, 6:50am UTC](https://community.jenkins.io/t/archive-artifacts-stage-deprecated-in-newer-jenkins-version/6436/2 "2023-03-24T06:50:46Z")

</div>

can anyone reply on this issue please

---

<div class="post-metadata">

**Author:** ![Jana](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@Jana](https://community.jenkins.io/u/Jana)\
**Post date:** [March 24, 2023, 6:52am UTC](https://community.jenkins.io/t/archive-artifacts-stage-deprecated-in-newer-jenkins-version/6436/3 "2023-03-24T06:52:36Z")

</div>

Hi @vysyaraju  
pls check this if it helps [Recording tests and artifacts](https://www.jenkins.io/doc/pipeline/tour/tests-and-artifacts/)

---

<div class="post-metadata">

**Author:** ![Jana](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@Jana](https://community.jenkins.io/u/Jana)\
**Post date:** [March 24, 2023, 7:44am UTC](https://community.jenkins.io/t/archive-artifacts-stage-deprecated-in-newer-jenkins-version/6436/4 "2023-03-24T07:44:05Z")

</div>

@vysyaraju  
Example stage:

```auto
stage('archive') {
            steps {
                script {
                    def archiveString = 'build/libs/**/*.jar'
                    archiveArtifacts artifacts: archiveString, fingerprint: true
                }
            }
        }

```
