Al Christopher
Al Christopher

Reputation: 23

Jenkins is unable to locate file that can be located manually

When I added the commands that I use manually at the command prompt to run my project to Jenkins, Jenkins is unable to find the file that's referenced.

[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.631 s <<< FAILURE! - in TestSuite
[ERROR] main(test.java.IterateToEAMethods)  Time elapsed: 0.016 s  <<< FAILURE!
java.io.FileNotFoundException: Q:\A_Parts routing\03_Systeme\Selenium\Vega Automatisierung Teil 1\AutomatisierterSteuerungsantrag.xls (The system cannot find the path specified)
    at test.java.IterateToEAMethods.main(IterateToEAMethods.java:162)

When I run this project through the command line using the exact same commands it runs fine.

CD C:\Users\D171_o_QECJACK031\eclipse-workspace\VegaAutomatisierungPart2
mvn --settings settings.xml compile clean test

Does anyone know how to get Jenkins to have access to the file?

None of my other projects that use files have this problem and they run through Jenkins.

Upvotes: 0

Views: 787

Answers (1)

Altaf
Altaf

Reputation: 3086

You need to replace \ with \\ when accessing paths in windows. You could use dir with the path where your scripts are present :

// dir("<Your path where scripts are present>")
dir ("C:\\Users\\D171_o_QECJACK031\\eclipse-workspace\\VegaAutomatisierungPart2"){
     <Your commands>
 }

Upvotes: 1

Related Questions