

Then to use JRebel you just need to add the extra property. I have also added a debug message if the ‘rebelAgent’ property is not available.Īnother way would be to pass an optional property to the ‘bootRun’ task to use as a flag whether to add JRebel or not. Now running ‘bootRun’ would start the app normally, and if you want JRebel then use the ‘rebelRun’ task instead. There would be several ways of doing this, but one would be to add the JRebel startup configuration in an optional task. Make JRebel Optionalįor instance, what if you don’t always want JRebel everytime you start the app with ‘ bootRun’? JRebel plugins for IDE’s like Intellij IDEA are smart enough to give you the option of running your app with or without JRebel However there are several ways to improve on this. Then set the property in gradle.properties: It is basic but works fine.Īll you have to do is to add a few lines to adle:

#Jrebel static methods how to#
There is some documentation on how to add JRebel to a Spring Boot app that uses Gradle as the build tool.

Of course this short post is for newbies, and has only scratched the surface in terms of learning about all the new dependency configurations. You can continue to do this for Java application modules, but the documentation states that the Groovy plugin has compatibility issues with the Java-library plugin so will need a work around for library modules. The Groovy plugin extends the Java plugin and will handle the compilation for Java sources as well as Groovy sources. In the past I have used the Groovy plugin instead of the Java plugin for mixed projects. How about a project with Groovy as well as Java? This can be for a mixed Groovy / Java project, or for a Java project which needs Groovy for some support tools (such as Spock or Logback configuration). I think this also applies if you use Kotlin instead of Java.
#Jrebel static methods android#
In fact, when I recently upgraded my Android Studio, it came up with the message:Ĭonfiguration ‘compile’ is obsolete and has been replaced with ‘implementation’. So unless you are still using the 2.x version of Android Studio / Android Gradle plugin, the use of compile is deprecated. So you should use implementation, even for an app. Androidįor an Android project, the new configurations came with the Android Gradle Plugin 3.0. Having said that, I have tried using the Java-library plugin for an app project and it seems to work fine. Then you would use either implementation or api, depending on whether you want to expose the dependency to consumers of the library.įor a plain application project, you can stick with the java plugin and continue to use the compile configuration. Javaįor a Java project using Gradle 3.4+, then it depends on whether you are build an application or a library.įor a library project or a library module in a multiple module project, it is recommended to use the Java-library plugin, so in adle use this Other new replacement configurations were introduced as well, please read the documentation for further information.

Please note that in this post I am just using the compile vs implementation/ api configurations as an example. The idea was that the new configurations would help to prevent leaking of transitive dependencies for multi-module projects. Gradle 3.4 introduced the Java-library plugin, which included the then new configurations implementation and api (amongst others). These were meant to replace the compile configuration which was deprecated for this plugin. This post was a summary based on the documentation and StackOverflow questions to explain to him which configurations to use. Some of the examples were using the compile configuration for dependencies, while others were using implements and api.Ĭompile 'commons-httpclient:commons-httpclient:3.1'Ĭompile ':commons-lang3:3.5'Īpi 'commons-httpclient:commons-httpclient:3.1'
#Jrebel static methods code#
While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples.
