Step Archive artifacts after assembly do not care about your POM. All he does is search for files in the workspace folder, i.e. $WORKSPACE (also available via http://[jenkins-url]/job/[job-name]/ws ) and archiving in the Jenkin build history.
The files you are trying to archive must exist in $WORKSPACE . From your configuration, you are trying to archive **/target/*.apk , which means "on any path, target folder with any file and the extension .apk ". He cannot find this, since your workspace does not have a target folder anywhere, therefore ERROR: '**/target/*.apk' doesn't match anything: '**' exists but not '**/target/*.apk'
In your POM file, you have the following line: <directory>${project.basedir}/assets/build</directory>
This is what determines where your embedded files are. This is [base-dir-of-pom]/assets/build , not target .
Also create your console log:
[JENKINS] Archiving /var/opt/jenkins/workspace/Android-Project-App/trunk/assets/build/project-android.apk
Which once again proves that your .apk artifact is actually located in trunk/assets/build
For your artifact archive file you need to use:
**/assets/build/*.apk
And in fact, you can only use:
**/build/*.apk or even
**/*.apk
But the question arises: do you really want to archive artifacts on Jenkins (which takes up space) when you are already archiving artifacts from Maven?
source share