Since the 4.0 release, there have been several reports of maven build errors like this one:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project xmlui: Error loading property file '[src]/dspace/modules/xmlui/../../../target/build.properties' -> [Help 1]
For example, see this thread:
Essentially, it looks as though there are scenarios where running 'mvn package' from [src]/dspace/ will fail to create or locate the necessary "target/build.properties" file.
As the error refers to a missing "[src]/target/build.properties" file, it seems likely related to changes applied in
DS-1528 to fix UTF-8 encoding issues in build.properties. The fix for DS-1528 was to copy the .properties file to [src]/target/ in order to encode it as UTF-8 *before filtering its values into dspace.cfg (and similar).
I've not had time to do further investigation on what the exact issue is & how to reproduce this error. However, I wanted to note my suspicions that
DS-1528 may have caused this problem. (NOTE: as you may see in the email thread above, I initially thought this was a documentation issue. But, I'm now suspecting that it's a bug in our Maven build process.)
For the time being, anyone encountering this error can just run "mvn package" from the root directory ([src]) instead of the 'dspace' subdirectory ([src]/dspace). Running Maven from the root directory seems to always work.