Posts

Showing posts from January, 2022

Trying out Java/Scala/Groovy artefacts on the fly

There are times when you need to try out a simple snippet using a Java/Scala/Groovy artefact published on Maven central or the corporate repository. Groovy (with all its goodness ) can help you just do that without requiring you to create a dummy Maven, Gradle or SBT project. The key piece is Grape which is a " JAR dependency manager embedded into Groovy. " For example let's say you need to quickly test something with Eclipse JGit . Assuming you have already installed Groovy (eg via sdkman .), drop into the terminal and type groovysh to enter, well, the Groovy shell . // Import the Grape API we need - it's just a static method groovy:000> import static groovy.grape.Grape.grab ===> static groovy.grape.Grape.grab // Ask Grape to download the specified artefact and all its dependencies. // You may find the details for your artefact in https://mvnrepository.com groovy:000> grab(group: 'org.eclipse.jgit', module: 'org.eclipse.jgit', vers...