DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > For Hibernate Developers, It's Time to Learn Gradle

For Hibernate Developers, It's Time to Learn Gradle

Mitch Pronschinske user avatar by
Mitch Pronschinske
·
Oct. 18, 10 · Java Zone · Interview
Like (0)
Save
Tweet
16.29K Views

Join the DZone community and get the full member experience.

Join For Free
The Hibernate team made it official when they recently switched the Hibernate 4 master branch on GitHub over to Gradle for its builds.  Now is as good a time as any to learn how the Gradle build system works in comparison to Hibernate's earlier build system, Maven 2.

If you're still wondering why the Hibernate developers decided to switch from Maven to Gradle, you can read these explanations and see what other developers had to say in this StackOverflow thread.

This is important news for anyone who's contributing to the open development of Hibernate.  Now, for those of you willing to try this Gradle thingy, it's always best to bookmark the project's documentation, which is mature and extensive.  This will be your go-to-guide for almost any question.  Since pre-4.0 versions of Hibernate use Maven for builds, most developers will want to know how certain things in Maven translate to Gradle.  For these developers, there is a three-part guide that helps Maven-users learn Gradle.

Intro to Gradle Video


JBoss developer Steve Ebersole also created a list of Gradle tasks that you will probably use the most:

  1. clean - Deletes the build directory.
  2. build - Assembles (jars) and tests this project.
  3. buildDependents - Assembles and tests this project and all projects that depend on it. So think of running this in hibernnate-entitymanager. Gradle would assemble and test hibernate-entitymanager as well as hibernate-envers because envers depends on entitymanager. See below.
  4. classes - compiles the main classes
  5. testClasses - compiles the test classes.
  6. test - Runs the tests for this project
  7. jar - Generates a jar archive with all the compiled classes.
  8. uploadArchives - think Maven deploy
  9. install - I have also enabled the MavenPlugin throughout the projects, which adds this task. install installs the project jar into the local maven repository cache (usually ~/.m2/repository), which is important to inter-operate between projects using Maven to build and those using Gradle to build (otherwise you'd have to push your artifacts to Nexus to “share”)

The newest version of Gradle is 0.9, which is currently in the release candidate stage.  Here's what's new in Gradle 0.9.
Gradle Hibernate dev

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 10 Books Every Senior Engineer Should Read
  • 6 Best Books to Learn Multithreading and Concurrency in Java
  • Maven Tutorial: Nice and Easy [Video]
  • Querying Kafka Topics Using Presto

Comments

Java Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo