I have an ant file which has move and copy tasks. The source and destination locations are on the mapped network drive R:\
. When I run them on the command prompt the build is successful but when I configure it as a job in Jenkins
, the tasks are failing with the below console output.
BUILD FAILED
C:\Users\admin\.jenkins\jobs\CopyTask\workspace\build.xml:24: R:\dest does not exist.
Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
Both the standalone build and Jenkins build are under the same user credentials.
I have looked in the the questions copy in ANT throws java.io.FileNotFoundException and Ant Copy Task: Failed to copy due to java.io.FileNotFoundException but it didn't help me solve the issue.
EDIT
Jenkins service was running under local system account and in Jenkins app, I was using "Jenkins's own user database" for Security Realm. I had created a user called "admin" with all the permissions granted. After looking in to this link, I installed Active Directory Plugin and used an administrator account credentials to start the Jenkins service. But still I am getting the below error message
BUILD FAILED
C:\Users\admin\.jenkins\workspace\CopyTask\build.xml:11:
Failed to copy C:\Users\admin\FldrToCopy\data.7z to
R:\data.7z due to failed to create the parent directory for R:\data.7z
Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE