The publish plugin breaks in the case that the maven-publish plugin (or the bintray publish plugin) is present. It complains that the method “
org.apache.maven.model.Dependency.getOptional()Ljava/lang/String” cannot be found. It is likely a version conflict in loaded maven model classes. This is on gradle 2.12
Other relevant plugins:
id "com.jfrog.bintray" version "1.6" id "com.gradle.plugin-publish" version "0.9.4"
The entire script is on github: https://github.com/pdvrieze/gradle-codegen