IOS(Appium) + Maven+Jenkins issue

@Sanjay_Sharma

cd /Users/username/Documents/workspace/bttt.ios.com
ls //prints folder for debug. check that you see your pom here
mvn clean test

is correct. what error it is giving? your error is from first try.

@Alekse I checked in terminal by running this command
cd /Users/username/Documents/workspace/bttt.ios.com
ls

POM.xml is present there

I tried this one in execute shell

cd /Users/username/Documents/workspace/bttt.ios.com/

mvn clean test

I got this in Jenkins console output

Started by user admin
Building in workspace /Users/Shared/Jenkins/Home/workspace/freemaven
[freemaven] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson1185427470113418483.sh

  • cd /Users/username/Documents/workspace/bttt.ios.com/
    /Users/Shared/Jenkins/tmp/hudson1185427470113418483.sh: line 2: cd: /Users/username/Documents/workspace/bttt.ios.com/: Not a directory
    Build step ‘Execute shell’ marked build as failure
    Finished: FAILURE

Regards,
Sanjay

@Sanjay_Sharma
i tried on mine side similar and had zero problems.

let confirm one more time. according to mine understanding your folder should be like:

/Users/amit/Documents/workspace/bttt.ios.com

but not

/Users/username/Documents/workspace/bttt.ios.com

where “amit” is your user login.

@Aleksei This is the correct

/Users/amit/Documents/workspace/bttt.ios.com

and pom.xml is in this project bttt.ios.com.

so can you in terminal on your PC/MAC execute:

cd /Users/amit/Documents/workspace/bttt.ios.com - manually?

if it working manually it should word in jenkins the same.

example of mine logs where i am navigating to with “cd” to xcode folder and printing folders inside (XXXX - just sensitive info removed)

Building remotely on macMini_3 (build_Android build_iOS) in workspace /Volumes/secret/workspace/development_Dev
+ cd /Users/jenkinss/Library/Developer/Xcode/DerivedData
+ ls
ModuleCache
XXXXX-bcdvkgmstxfnlofdpwvvdakfamxb

When I am running my script from terminal using

mvn clean test

it’s working absolutely fine only issue is coming when running with jenkins.

no - in terminal execute:

cd /Users/amit/Documents/workspace/bttt.ios.com

will you succeed?

Yes in terminal when I am executing this

cd /Users/amit/Documents/workspace/bttt.ios.com

its working fine.

see this o/p from terminal

Last login: Tue Jun 20 15:36:36 on ttys002
Boutiqaats-Mac-mini:~ amit$ cd /Users/amit/Documents/workspace/boutiqaat.ios.com
Boutiqaats-Mac-mini:boutiqaat.ios.com amit$ ls
pom.xml src target test-output testng.xml
Boutiqaats-Mac-mini:boutiqaat.ios.com amit$

so same in jenkins does not work?

See this I am giving same command here

and the console o/p I am getting this

Started by user admin
Building in workspace /Users/Shared/Jenkins/Home/workspace/freemaven
[freemaven] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson5753162084320192990.sh

  • cd /Users/amit/Documents/workspace/boutiqaat.ios.com
    /Users/Shared/Jenkins/tmp/hudson5753162084320192990.sh: line 2: cd: /Users/amit/Documents/workspace/boutiqaat.ios.com: Not a directory
    Build step ‘Execute shell’ marked build as failure
    Finished: FAILURE

so it is look like your jenkins user in folder /Users/Shared/Jenkins/Home/workspace… do not have access to your user amit.

@Aleksei I will check this

@Aleksei Thanks for your all help, Today I uninstalled and installed again my jenkins through CLI

java -jar jenkins.war

and after that, I created one maven project and Under ROOT POM I gave only pom.xml and clean and test in goals.

and under Advanced I used custom workspace and gave the path till my project and it worked.

Thanks,
Sanjay

@Sanjay_Sharma wow :slight_smile: so many steps… next time i suggest put test code into github and pull it into jenkins workspace instead.

@Aleksei Yes, will do the same.