I have one zip artifact of one repo present on the nexus repo. In compile phase, I need to download it in another repo using pom.xml and later move it to another folder using Docker.
To unpack the zip, I've written the following plugin in the pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>unpack</id>
<phase>compile</phase>
<goals>
<goal>unpack</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>projectGroupId</groupId>
<artifactId>ProjectAtrefact</artifactId>
<version>${project.version}-SNAPSHOT</version>
<type>zip</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/deps/dev</outputDirectory>
<overWrite>true</overWrite>
<stripVersion>true</stripVersion>
<excludeTransitive>true</excludeTransitive>
<includes>**</includes>
</configuration>
</plugin>
In the bamboo log, the zip file is downloaded and unpacked and the maven stage is successful.
[INFO] Downloaded from snapshots: http://repo.xyz.com:8081/nexus/content/groups/libs-snapshot/com/<parent>/<project>/1.0.0-SNAPSHOT/<project>-1.0.0-20220930.103511-22.zip (1.3 MB at 30 MB/s)
build 30-Sep-2022 10:41:36 [INFO] Unpacking /mnt/bamboo-ebs/bamboo-agent/artifacts/com/<parent>/<project>/1.0.0-SNAPSHOT/<project>-1.0.0-SNAPSHOT.zip to /mnt/bamboo-ebs/bamboo-agent/build-dir/SHARED-AD1-JOB1/target/deps/dev with includes "*" and excludes ""
With the above, the unpacked zip folder should be present in the target/deps/dev folder but when I did RUN ls -lR target it is saying the folder does not exist.
#9 [4/6] RUN ls -lR target
error 30-Sep-2022 10:42:05 #9 sha256:185ecaf76c80e6942603dec50ea957ddae25e329ceeed2c8b485455b6d3c92e2
error 30-Sep-2022 10:42:05 #9 0.508 ls: cannot access target: No such file or directory
error 30-Sep-2022 10:42:05 #9 ERROR: executor failed running [/bin/sh -c ls -lR target]: exit code: 2
What I am doing wrong here? Any advice?
<outputDirectory>${project.build.directory}/deps/dev</outputDirectory>this should create the directorytarget/deps/devand also confirmed from the bamboo logs -/mnt/bamboo-ebs/bamboo-agent/build-dir/SHARED-AD1-JOB1/target/deps/devthe folder is created in the root folder by bamboo agent. After this maven task is completed, the next task is the docker run which should get the target folder.