Running maven command remotely using ssh - maven

Trying to execute a script on the remote aws centos machine using the command mentioned below
ssh root#hostname script
Everything works fine until the script comes to a maven command. For example "mvn package" in the script. Getting the error below.
bash: mvn: command not found

Related

Using WSL2 to execute jenkins scripts made for linux nodes

We have been using linux test bots so far in Jenkins and have made groovy scrpts that call bash scripts to execute tests. Now we need to add Windows test bots to the pool but we cant start WSL from the script.
Is there any way to use WSL instead of bat / powershell to run bash commands in jenkins pipelines?
using for example wsl -l or wsl + one command works, but just executing the command wsl from the code does not give any error.
Manually triggering wsl from cmd / powershell on the device directly works without any issues.

bash.exe not working on Jenkins (Windows)

When running a build under "Execute Windows batch command" with the "C:\Windows\System32\bash.exe --version" it fails with the error "exit -1073741819".
If I run the same command on the windows command line on the same machine but locally, it works just fine.
Any inputs on where I am failing? I am trying to avoid using git or cygwin and just keep things equal as when I manually run it.
Prints:

Cannot run ant from apache localhost (ant: command not found)

I have setup my localhost on macOS big sur with apache and php (works fine). I now have a bash script that uses ant to build some source code, but I cannot run the ant command from within a bash script from the browser. I always receive ant: command not found. I can run the bash script from the terminal with my user and the webuser (_www) ant this works as intenden. But I cannot get it to work when I call the site from my browser. Any ideas?

Error env: ruby_executable_hooks: No such file or directory while running Slather on Jenkins

I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server.
Here is the script I am running through slather
slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home/workspace/TestApp/TestApp.xcodeproj
Here is the PATH variable I am setting while executing this shell
$PATH:/Users/Shared/Jenkins/.gem/ruby/2.4.0/bin
Finally fixed this issue by running the following shell command using Jenkins.
$Home/.rvm/gems/ruby-2.4.1/wrappers/slather
Earlier, I was referring to
$Home/.rvm/gems/ruby-2.4.1/bin/slather
and the bin does not have ruby environment support when executed via shell script.

SSH into another machine and run robot framework tests

I can run tests on remote machine as pybot test.robot. Now I want to ssh into remote machine from local machine and run above command. I can ssh into remote machine as ssh user#10.0.0.200 ls and see files.
But when I try to run command ssh user#10.0.0.200 pybot ~/dir/test.robot I get error bash: pybot: command not found
pybot is installed on remote machine I can run tests successfully if I run them directly from remote machine.
Try to export your PATH and LD_LIBRARY_PATH at the top of your .bashrc config file. For instance:
export PATH=path-to-the-pybot-directory:$PATH
export LD_LIBRARY_PATH=path-to-lib-directory-for-pybot:$LD_LIBRARY_PATH
You may use ldd pybot to locate where libraries requiered by pybot are installed.

Resources