I have now officially moved our new projects to gradle. It builds just like it did with Maven.
However one caveat.
After a change in our API, which also builds with gradle, published to Nexus then now our application using it are getting compile error. It does not seem to use the latest SNAPSHOT of the API.
I have removed a deprecated interface method in the API, but our application is still complaining that this interface method is not implemented.
MyServiceMock is not abstract and does not override abstract methodd serviceCall(boolean,String...) in MyService
public class MyServiceMock implements MyService {
When I was running gradle eclipseClasspath it downloaded the latest SNAPSHOT of the API, but “gradle build” still failed.
I have not run initially run gradle publish of the API locally for this latest change. It was built by our CI and published to Nexus.
I later tried with running gradle publish locally, but it would not solve it.
repositories {
maven {
url nexusUrl + "/public"
}
mavenLocal()
}
dependencies {
compile group: 'com.company', name: 'server-api', version:'1.0.0-SNAPSHOT'
}
The only thing that worked was to delete ~/.gradle/caches, but that is not a viable solution. I cannot go into each and every build system and delete the gradle caches. Which I now will have to do (only this once). What about next time, If I cannot rely on Gradle to fetch the latest SNAPSHOT of a dependency. Something seems to be wrong with its caches.
I also had to killed the running Gradle Daemon, because after deleting the cache it failed
Task :compileJava FAILED
Error occurred during initialization of VM
java.lang.InternalError: Could not create SecurityManager: worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager