![]() ![]() ![]() Where the method parameter plugin:"java" is equivalent to with key=plugin and value=java. It's better to understand a little how groovy works.Ībove line is nothing but a method call equivalent to the following: apply(plugin: "java") Let's create a directory at D:\gradle-getting-started-example and add adle file (this is the main gradle file where we do all configuration) adle apply plugin: "java" Quick understanding of Gradle DSLĪbove line is written in Groovy language but the 'apply' part is defined by Gradle DSL API. In this example we are going to create a Java project. To fix this warning set following in D:\gradle-4.10.2\bin\gradle.bat ( gradle issue #2995 ) : set JAVA_OPTS=-add-opens=java.base/java.lang=ALL-UNNAMED -add-opens=java.base/=ALL-UNNAMEDĬheck again: C:>gradle -v - Gradle 4.10.2 - Build time: 18:10:15 UTC Revision: b4d8d5d170bb4ba516e88d7fe5647e2323d791dd Kotlin DSL: 1.0-rc-6 Kotlin: 1.2.61 Groovy: 2.4.15 Ant: Apache Ant(TM) version 1.9.11 compiled on MaJVM: 11 (Oracle Corporation 11 28) OS: Windows 10 10.0 amd64 The warning shown at the end are due to Java 9 modules changes. I am using JDK 9.Ĭhecking the installation: C:>gradle -v - Gradle 4.10.2 - Build time: 18:10:15 UTC Revision: b4d8d5d170bb4ba516e88d7fe5647e2323d791dd Kotlin DSL: 1.0-rc-6 Kotlin: 1.2.61 Groovy: 2.4.15 Ant: Apache Ant(TM) version 1.9.11 compiled on MaJVM: 11 (Oracle Corporation 11 28) OS: Windows 10 10.0 amd64 WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by .CachedClass (file:/D:/gradle/gradle-4.10.2-bin/gradle-4.10.2/lib/groovy-all-2.4.15.jar) to method () WARNING: Please consider reporting this to the maintainers of .CachedClass WARNING: Use -illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release JAVA_HOME environmental variable should also be set. After downloading, unzip the package (gradle-4.10.2-all.zip) anywhere and set the bin folder in system path ( D:\gradle-4.10.2-all\gradle-4.10.2\bin). I chose 'Complete, with docs and sources' option (instead of 'Binary-only') because that helps in Intellij (even in community edition) to see Gradle's documents and source code. I prefer to download zip package from here. Gradle can be download via various methods. A custom plugin can also be built in any JVM based language. Gradle comes with various built-in plugins.Like Maven, Gradle also provides convention over configuration.It downloads the dependent jars, saves and reuse them from local cache ( USER_HOME/.gradle folder). Like Maven, Gradle also provides a dependency management system.It also uses build cache and keeps build information in runtime memory to improve the performance. It tracks source file changes and processes only what is necessary. Gradle is considered to be faster than Maven.As opposed to Maven's rigid model, Gradle is very flexible and can be extended easily.It provides its own Groovy-based domain language (DSL) instead of XML for its build scripts.Same happens with gradle version 4.1.Ģ) Is that a good idea to use gradle version 4.x.x or 5.x.x with grails version 3.x.x as with gradle 5.x.x I start to get even more issues as some grails plugins(like grails-gsp v3.3.2 which is latest stable version) use some features that have been deprecated in gradle 4.x.x and removed from gradle 5.x.x (see the error bellow)?įailed to apply plugin Ĭould not get unknown property 'classesDir' for main classes of type. tutorials shows a quick getting started example of Gradle. However when I upgrade gradle version to 4.10.3 then I start to get this error. Location of class is src/main/groovy/com/abnd/CarStatusEnum in the same project where the build is being run and gradlew war task completes successfully with gradle version 3.4.1. When I run gradlew war after upgrading gradle version to 4.10.3 I start to get the following error during execution of compileGroovyPages task:ĭashboard_gsp.groovy: 2: unable to resolve class line 2, column 1. Gradle initial version: 3.4.1 (everything works fine with this version). ![]()
0 Comments
Leave a Reply. |