How to find the correct path of the artifact created by mvn package so I can use with scp

I want to deploy a folder created by package stage from gitlab to a remote server. I have compiled, packaged and created the connection successfully with the target host but cannot find the artifact folder. As an artifact folder path I have chosen the one from job logs which says:
Building jar: /builds/taulantmehmeti91/myproject/build/ , so I assume /builds/taulantmehmeti91/myproject/build/ is the build folder and I’m using it as:
scp -P 4444 -o StrictHostKeyChecking=no -r /builds/taulantmehmeti91/myproject/build taulant@x.x.x.x:/home/taulant but getting the no such file or directory error for the /builds/taulantmehmeti91/myproject/build/ path

Is there anyway to specify the path to the package stage then access it at the deploy stage or is there any other way to access this path?

Is there anyway to specify the path to the package stage then access it at the deploy stage or is there any other way to access this path?

I believe jobs cannot see files created by other jobs unless you define them as artifacts, and the job that will use the artifact either needs to be in a later stage or have a dependency defined on the artifact-creating job.

See:

1 Like

I fixed it by adding artifacts to the package stage.
Code:
code

and the scp command: scp -P 4444-o StrictHostKeyChecking=no -r build taulant@x.x.x.x:/home/taulant

P.S sorry for the picture upload, didn’t know how to format the code properly