Bamboo Artifacts partly missing

3.3k views Asked by At

I'm trying to copy artifacts after the Bamboo build finishes. I have set it to copy from the maven target to get site report. Like so to get all the directories and files from the target dir.

/target/
*.* 

When I look at the artifacts after the build run, I only have one directory and the .war file that was created during the build. I'm puzzled why I'm not getting the /site dir and the others /cobertura etc,

1

There are 1 answers

0
Steffen Opel On BEST ANSWER

I take it that you are using Bamboo's Artifact definitions as outlined in Configuring a job's build artifacts, i.e. according to the image below your artifact's Location is /target/ and its Copy pattern is *.*?

In case, please note that the Copy pattern isn't a common DOS/UNIX wildcard one, rather an Ant file copy pattern:

In general, patterns are considered relative paths, relative to a task dependent base directory [...]. Only files found below that base directory are considered.

This specifically allows to create patterns for the selective inclusion and exclusion of files from an entire directory hierarchy rather than just from the top level one (which might include entire directories of course). The latter is apparently what you actually intended by applying the DOS/UNIX wildcard *.*, but as an Ant pattern this just matches all files within the top level directory:

Matching is done per-directory. This means that first the first directory in the pattern is matched against the first directory in the path to match. Then the second directory is matched, and so on. For example, when we have the pattern /?abc/*/*.java and the path /xabc/foobar/test.java, the first ?abc is matched with xabc, then * is matched with foobar, and finally *.java is matched with test.java.

Furthermore, you can use the special pattern ** to match multiple directory levels:

When ** is used as the name of a directory in the pattern, it matches zero or more directories. For example: /test/** matches all files/directories under /test/, such as /test/x.java, or /test/foo/bar/xyz.html, but not /xyz.xml.

Long story short, in order to include all files and directories within Location target as specified you simply need to use **/*.