Thursday 23 March 2017

Maven : Compilation of Groovy Class files

There are various ways to build and use your groovy class files, you can use Gradle, or Goovyc Ant or using maven. In maven we have two main possibilities, one with GMaven and the other with Groovy eclipse.

I will elaborate an example with GMaven. GMaven Plugin definition requires the groovy dependency (groovy-all).

Below is an example of a pom file which compiles all the groovy class files located in a specific location.



In this example, my scripts are making connection to an oracle 12g database, hence I had to add dependency for ojdbc and since the DB is in 12G I was facing further errors related to xdb.war. So I downloaded the war file and installed it on maven using command below.

mvn install:install-file -Dfile=xdb6.jar -DgroupId=com.oracle -DartifactId=xmlparserv2 -Dversion=12.1.0.2 -Dpackaging=jar

After installing the war to my maven repository and added the same to dependencies as shown in example above.

Now I can use the above maven pom in my master file and other child pom build can use the classes compiled from it.

No comments:

Post a Comment