DZone
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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • What Is JHipster?
  • Java String Templates Today
  • Integration Architecture Guiding Principles, A Reference
  • Data Freshness: Definition, Alerts To Use, and Other Best Practices

Trending

  • What Is JHipster?
  • Java String Templates Today
  • Integration Architecture Guiding Principles, A Reference
  • Data Freshness: Definition, Alerts To Use, and Other Best Practices
  1. DZone
  2. Coding
  3. Java
  4. Checking in binaries

Checking in binaries

Paul Hammant user avatar by
Paul Hammant
·
Oct. 28, 14 · Interview
Like (0)
Save
Tweet
Share
5.60K 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.

Trending

  • What Is JHipster?
  • Java String Templates Today
  • Integration Architecture Guiding Principles, A Reference
  • Data Freshness: Definition, Alerts To Use, and Other Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • 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

Let's be friends: