Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Checking in binaries

DZone's Guide to

Checking in binaries

· Java Zone
Free Resource

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

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.



Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

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

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}