Comparing artifacts

Comparing artifacts

The compare section

If you used spaces to build multiple versions of the same artifacts, you can also automatically compare them, to make sure their content is identical. The “compare” section implements an automatic artifact comparison. The content of the corresponding section is the following:

{
 build: {projects:..., options:...}

 options: {
  deploy: ...

  compare: [{
    a : [<project1>,<project2>,...]
    b : [<project1>,<project2>,...]
    skip : [ <glob1>,<glob2>,... ]
  }, ... ]
 }
}

The specification of the lists of projects is the same previously described in The deploy section. At the end of the compilation, dbuild will compare the jars generated by the two lists of projects. If the comparison fails, a report of the differences will be printed, and the final build outcome will reflect the error condition. The two sides are always identified by using “a” and “b” as labels.

The (optional) list of strings in skip can be used to exclude certain files from the comparison. The files, within each jar, whose path match the given pattern will be excluded. The patterns are specified in a shell-stype glob format, for instance:

skip: [ "*.properties", "*.html", "META-INF/MANIFEST.MF", "dir?/src/*" ]

Further details on the supported glob syntax can be found here.

Note that only the jars of the artifacts are compared; the POM or ivy.xml files, or other files generated as part of the artifacts, are not inspected for equality.


Next: Repositories.