问题
Is there a way to save/archive multiple artifacts from the same build?
Jenkins only allows a single 'Archive the Artifacts' post build step, and grey's out the option after it has been used once.
Maybe the ArtifactsArchiver
's allows multiple patterns?
回答1:
You can use Ant-style pattern, e.g. target/*.jar
to archive multiple artifacts.
And it is possible to use a comma separated list of patterns if your files can't be matched with one pattern, e.g. target/*.jar, target/*.war
.
The ? button next to the input field reveals this info.
回答2:
You can comma separate the paths, like this:
XXX.UnitTests\bin\Release\**.* , XXX.WriteAPI.Service/bin/Release/**.*
Then you get two separate artifacts.
See http://ant.apache.org/manual/Types/fileset.html for details of the Ant Pattern syntax.
回答3:
If you want to save two different types of files like zip files and html files, then you can use
*.html,*.zip
It will help you to archive all zip files and html files in that directory.
回答4:
No, jenkins does not provide only one artifact to save. You can use wild card pattern to same any number of artifacts, For example All Jars - **/*.jar All War - **/*.war and so on.
**/ means Any directory.
来源:https://stackoverflow.com/questions/32823684/jenkins-multiple-artifacts-for-the-same-build