When a file changes from being a symlink to a text file (using the same name) P4jenkins wont detect it properly because 'p4 reconcile' is not using the '-t' flag. This causes problems later in the job:
P4 Task: reconcile files to changelist.
... p4 revert -k +... p4 sync -k +... p4 reconcile -e -a -f +... p4 opened -Cjenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9 +duration: (24ms)
P4 Task: publish files to Perforce.
... p4 change -i
+... p4 change -o 2047
+... pending change: 2047
... p4 reopen -c2047 +... p4 change -o 2047
+... p4 opened -Cjenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9 +... ... edit ... submitting files
... p4 describe -s 2047
+... p4 fixes -c2047
+... p4 submit -i
Unable to publish workspace: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s):
Client side operation(s) failed. Command aborted.
Build step 'Perforce: Publish assets' marked build as failure
When you check the workspace 'windows_file_symlink' is opened for edit as type 'symlink'.
(1) Using a windows client create a target file ('a_target').
(2) Create a symlink ('windows_file_symlink') to the target using 'mklink'.
(3) Submit both files to the depot.
(4) Create a Jenkins job that syncs both files and then publishes changes from that workspace. Include a build step that is a batch file that replaces the symlink with the file contents. For example:
attrib -r windows_file_symlink
copy a_target windows_file_symlink
(7) Execute the Jenkins job.