A demonstration on how to integrate different JVM languages into a multi-module Maven build.
Java Ruby Clojure Scala Groovy Xtend Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
all
clojure
frege
gosu
groovy
java
kotlin
python
ruby
scala
xtend
.gitignore
.travis.yml
LICENSE
README.md
pom.xml

README.md

polyglot-java Build Status

polyglot-java demonstrates how to integrate different JVM languages into a multi-module Maven build.

Covered Languages

Requirements

Java 1.8.0

$ export JAVA_HOME=/opt/jdk-1.8.0
$ export PATH=$JAVA_HOME/bin:$PATH

$ java -version
java version "1.8.0_131"
...

Maven 3.5

$ export M2_HOME=/opt/maven-3.5
$ export PATH=$M2_HOME/bin:$PATH

$ mvn --version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
...

Usage

$ git clone https://github.com/vakuum/polyglot-java.git

Execute

$ cd polyglot-java
$ cat all/src/main/java/polyglot/All.java
$ mvn clean install -DskipTests
$ mvn exec:java --projects all
...
Hello, I am Java!
Clojure: Hello Java!
Frege: Hello Java!
Gosu: Hello Java!
Groovy: Hello Java!
Java: Hello Java!
Kotlin: Hello Java!
Python: Hello Java!
Ruby: Hello Java!
Scala: Hello Java!
Xtend: Hello Java!
...

Execute a specific module

$ cd polyglot-java
$ mvn clean install -DskipTests
$ mvn exec:java --projects clojure
...
Clojure: Hello Clojure!
...

$ mvn exec:java --projects frege
...
Frege: Hello Frege!
...

$ mvn exec:java --projects gosu
...
Gosu: Hello Gosu!
...

$ mvn exec:java --projects groovy
...
Groovy: Hello Groovy!
...

$ mvn exec:java --projects java
...
Java: Hello Java!
...

$ mvn exec:java --projects kotlin
...
Kotlin: Hello Kotlin!
...

$ mvn exec:java --projects python
...
Python: Hello Python!
...

$ mvn exec:java --projects ruby
...
Ruby: Hello Ruby!
...

$ mvn exec:java --projects scala
...
Scala: Hello Scala!
...

$ mvn exec:java --projects xtend
...
Xtend: Hello Xtend!
...

Executable JAR

$ cd polyglot-java
$ mvn clean install -DskipTests
$ mvn assembly:assembly --projects all -DskipTests
$ java -jar all/target/polyglot-java.jar
...
Hello, I am Java!
Clojure: Hello Java!
Frege: Hello Java!
Gosu: Hello Java!
Groovy: Hello Java!
Java: Hello Java!
Kotlin: Hello Java!
Python: Hello Java!
Ruby: Hello Java!
Scala: Hello Java!
Xtend: Hello Java!
...

Tests

$ cd polyglot-java
$ cat all/src/test/java/polyglot/TestAll.java
$ mvn clean install -DskipTests
$ mvn test --projects all
...
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
...

License

Copyright (c) 2012-2017 Clemens Fuchslocher, released under the MIT license.