开发者

jenkins ci : how to select the artifacts to be archived

开发者 https://www.devze.com 2023-04-02 15:19 出处:网络
I\'m using Jenkins to build a maven 2 project. As part of the build a couple of jar files get generated in the target directory. I would like Jenkins to archive/copy a specific jar from the target loc

I'm using Jenkins to build a maven 2 project. As part of the build a couple of jar files get generated in the target directory. I would like Jenkins to archive/copy a specific jar from the target location to a custom folder.

How can I achieve this ? I've tried using the 'Archive the artifacts' post build option but it does not allow me to select the file under target. I get a er开发者_如何学Goror message saying such a location does not exist.

I'm new to Jenkins so any help is appreciated.

Thanks.

Sirius


You may have your file specification or the base directory for the artifacts wrong. From the help text:

Can use wildcards like 'module/dist/*/.zip'. See the @includes of Ant fileset for the exact format. The base directory is the workspace.

So you'll need to figure out where your target directory is relative to the workspace directory.


The archive feature copies/saves your build artifacts out of the workspace into the build's individual directory. You cannot specify where it puts them. That said, I would probably leave archiving turned on if you'll ever need to refer back to a previous version.

You can use a script build step to create the dir if it does not exist and perform the copy.

But you have not said why you want to move the artifacts around. If it is to make them available to other projects, you should look instead at the Copy Artifact build step.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号