Work arounds for Build LinkErrors - AtlasOfLivingAustralia/profile-hub Wiki

Not applicable for profile-hub version 3.0 and above

Grails and the release plugin

Background

Grails 2.5 and the Grails Release Plugin 3.1.2 are incompatible once one strays from the well worn path of exact release version numbers. The probable cause of these incompatibilities is that Grails 2.5 depends on Maven 3 jars whereas the Release plugin depends on Maven 2 jars.

The OWASP Java HTML Sanitizer library (as of release 20160203.1) has dependencies on Guava and Commons Codec but expressed them as version ranges (ie [11.0,) and [1.4,)). It appears that resolving these dependencies causes the Grails Release to crash with a MethodNotFoundError. Similarly, using a -SNAPSHOT version of a plugin would cause a LinkError from differing versions of the Apache HTTP Client.

OWASP Java HTML Sanitizer dependency

To work around the issues with the Java HTML Sanitizer dependency, we have forked the project at AtlasOfLivingAustralia/java-html-sanitizer and locked the dependencies in the pom.xml to specific versions (11.0 and 1.6).

It should be noted that other solutions such as setting the versions explicitly in the dependency management or dependency section of the Grails BuildConfig did not stop the crashes from occuring.