Home > Back-end >  Runtime can increase or decrease the dynamic data source
Runtime can increase or decrease the dynamic data source

Time:11-05

The home page
Gradle + Groovy based article
In Java project, there are two main building systems: Gradle and Maven build system main management potential complex dependencies and compile the program correctly, can also be compiled programs as well as all the resources and packaged in the source file. The war or. Jar file, for the construction of a simple, choose between Maven and Gradle almost one of personal preference, or perhaps the CTO or technical manager's preference, they were both very good build tools, however, for more complex projects, Gradle Maven superior,

The advantages and disadvantages of Gradle build
People like Gradle; I hate XML, complex Java/Groovy project, if there is no Gradle, is almost impassable, except there are no complicated XML Gradle build scripts written in Groovy or Kotlin also provides flexibility and faster construction speed, with the aid of all functions of the Kotlin or Groovy and Gradle API library, you can create a powerful and complex build script, it definitely is a tool for improving efficiency,

For DSL (domain-specific language) need some time to adapt to, and Gradle is famous for it is difficult to learn, but I think this is mainly because people have become accustomed to Maven, using Gradle, you can learn a language construct, essentially not just simply to learn XML, compared with only dependency is added in the Maven, make full use of Gradle has a steep learning curve, but add dependencies to the Gradle file is actually not difficult than in the Maven, extension and custom Gradle build than writing Maven plug-ins and custom build steps is much simpler,

Gradle also greatly shorten the build time, especially in large projects, because Gradle changed tasks and files only can finish the work well, in addition, it provides the building cache and build a daemon, making repeated construction of higher performance, and, like Maven, it USES parallel threads on dependency parsing and project construction, also, for small, simple construction, the performance may not be obvious, but for larger projects, the performance improvement is huge,

So, to summarize, Gradle is:

Large projects faster
Unlimited customizable==
a steep learning curveUsing Groovy or Kotlin instead of XML
The Maven is:

Generally used
For smaller projects more simple
With XML, and Angle brackets
The advantages of Groovy
Brief introduction of Groovy, Groovy is a JVM language, it can be compiled to the same as the Java byte code, and can be seamless interoperability with Java class, Groovy is backward compatible superset of Java, which means that Groovy can transparently with Java code libraries and interaction, but it also increased a lot of new features: optional type, functional programming, operation flexibility, and many metaprogramming content, it also greatly clean up the many long in the Java code format, Groovy has not yet become a mainstream development language, but it has in the test (because of its grammar and simplify programming function) and occupies a place in the build system,

Dependencies
You need to install some content for this tutorial:

Java: you may have installed Java, this tutorial will take at least Java 1.8, if not, please go to the website to download and install it,

Gradle: but, as a result of this tutorial is about Gradle tutorial, so in this tutorial, you can continue to install,

To know the build. Gradle
Build gradle file is the core of gradle project, is an essential part of a build configuration, such as pom, XML for Maven, this is the equivalent of unpleasant Angle brackets (not all)

Let's look at a,

CodePudding user response:

Where can see various JAVA show
  • Related