Posts

Showing posts with the label scala

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...

ADempiere: How To Use Scala For Customisations

Image
Scala is a viable alternative to Java. This guide shows how easy it is to develop ADempiere ERP customisations in Scala. Introduction Scala is becoming an increasingly popular language and for many companies/developers it's a superior alternative to Java. ADempiere open source ERP/CRM , is written in Java but since Scala runs on JVM and has very good Java interoperability, it's very easy to customise ADempiere with Scala. We'll see how it can be done. Prerequisites The only things you're going to need is ADempiere binaries.  You can either download them from SourceForge or build it directly from source with RUN_build (at the time of this writing 3.7.0LTS was the latest). JDK 1.6 Scala 2.10.x  (at the time of this writing 2.10.2 is the latest) SBT 0.12.x (at the time of this writing 0.12.4 is the latest) Project Template I have created a template project which is hosted on github to speed up things for people. First clone it: git clone https://github.com/bahm...