How to chnage archive artifact path default from target/*.jar to some other path

Hi we are storing our build .jar file in archive path using artifacts archive in jenknins,by default path is /target/.jar,can u pls guide how can we change it to other directory path to archive jar,for eg: /target/qa/.jar and target/uat/*.jar ?.

in freestyle it should be a text box, in pipeline its the first parameter. I’m not sure there’s a hard coded default, you always have to provide something.

How to archive artifact with commit id and also docker images from docker build also should push image to docker hub with that latest commit id.Our scenario is like in single build job only we have to store different environment same services artifact and that particular artifact should use for docker build.

You might want to review the video from Darin Pope where he advises that you should generally not try to use Jenkins as an artifact repository. It does store artifacts, but more sophisticated use models (like storing QA artifacts and different release versions) may lobby that you should consider an artifact repository.

can we use Maven git commit id plugin to include git commit hash as the version number for the build artifact.

I don’t know anything about the Maven git commit id plugin, so can’t answer that specific question.

I know that when I’m improving or testing or documenting certain Jenkins plugins, those plugins are configured to write their artifacts to an artifact repository and the artifacts that are written to the artifact repository include the git commit hash in the version number. The development environment for Jenkins plugins uses the term “incrementals” to describe that technique.