Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Component/s: publish-over-ssh-plugin
-
Labels:None
-
Similar Issues:
Description
If the source file selection returns no files then when flatten is specified an empty target directory is created. If flatten is not specified then no target directory is created when no files are selected.
Some of my builds only produce some artifacts for release builds and I copy these to separate locations with the publish-over-ssh. It gets very cluttered if the empty directories get produced for each non-release build.
I have a patch (pull request coming soon) that adds unit tests to show the behaviour with and without flatten specified. It also tweaks the flatten case to not produce the empty folders.
I'm not sure if anyone depends on empty folders being produced but if necessary I'll gladly update the patch to make it a configurable option to either suppress or force empty base folders.
Code changed in jenkins
User: Richard Mortimer
Path:
src/main/java/jenkins/plugins/publish_over/BPTransfer.java
src/test/java/jenkins/plugins/publish_over/BPTransferTest.java
http://jenkins-ci.org/commit/publish-over-plugin/ad1c610c6cd0fd3b01ad81a7549418d449f9291c
Log:
JENKINS-10599Publish over ssh with flatten creates empty directoryOnly create the target directory when the first file is copied.