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 > Checking in binaries

Checking in binaries

Paul Hammant user avatar by
Paul Hammant
·
Oct. 28, 14 · Java Zone · Interview
Like (0)
Save
Tweet
5.39K Views

Join the DZone community and get the full member experience.

Join For Free

When Maven came out some twelve years ago, the Java community became comfortable with not checking in third-party binaries. In the Ant era, before that, you did. Maybe we were being kind to source control systems, but we opened a new can of worms.

While I spent a lot of time being an advocate of that design, I’m not any more. It’s time we checked in binaries again, and yes that means even into Git (where small repos historically rule).

Gradle

Gradle is a very elegant and terse build grammar for the Java eco-system. Inside their main SDK download, there is a “samples/webApplication/quickstart” folder that has a neat minimalist “hello world” web app. Putting that under source control with “git init” is easy :)

cd samples/webApplication/quickstart
git init
wget --no-check-certificate https://www.gitignore.io/api/java,maven,gradle --output-document=.gitignore
mkdir gradle_home
gradle --gradle-user-home gradle_home war
git add gradle_home
git commit -am "check in downloaded jars n all"

But if you run the gradle line again, it does things that would result in another checkin, when it should not In my opinion:

modified:   gradle_home/caches/2.1/scripts/build_jmcktaacs2o3f7glfb3tb17ev/ProjectScript/buildscript/cache.properties

modified:   gradle_home/caches/2.1/scripts/build_jmcktaacs2o3f7glfb3tb17ev/ProjectScript/buildscript/cache.properties.lock

modified:   gradle_home/caches/2.1/scripts/build_jmcktaacs2o3f7glfb3tb17ev/ProjectScript/no_buildscript/cache.properties

modified:   gradle_home/caches/2.1/scripts/build_jmcktaacs2o3f7glfb3tb17ev/ProjectScript/no_buildscript/cache.properties.lock

deleted:    gradle_home/caches/2.1/scripts/build_jmcktaacs2o3f7glfb3tb17ev/ProjectScript/no_buildscript/classes/build_jmcktaacs2o3f7glfb3tb17ev$_run_closure3.class

deleted:    gradle_home/caches/2.1/scripts/build_jmcktaacs2o3f7glfb3tb17ev/ProjectScript/no_buildscript/classes/build_jmcktaacs2o3f7glfb3tb17ev$_run_closure3_closure4.class

modified:   gradle_home/caches/2.1/scripts/build_jmcktaacs2o3f7glfb3tb17ev/ProjectScript/no_buildscript/classes/build_jmcktaacs2o3f7glfb3tb17ev.class

modified:   gradle_home/caches/modules-2/modules-2.lock

Too bad. Maybe Gradle 3 will rework the caches folder to more clearly separate sections that can be checked in, from those that should not be.

Maven

I didn’t try Maven as I could not work out how to redirect the local repository without changing settings.xml for all projects.



source control Gradle Apache Maven Java (programming language) app Cache (computing) IT Repository (version control)

Published at DZone with permission of Paul Hammant, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Low Code and No Code: The Security Challenge
  • When Writing Code Isn't Enough: Citizen Development and the Developer Experience
  • Model Quantization for Edge AI
  • Secure Your WSO2 Micro Integrator Deployment

Comments

Java Partner Resources

X

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