Friday, April 15, 2011

Using maven to build java+groovy projects

I have just started new project where I plan to use Java and Groovy at the same time. Groovy will be used primarily for implementing configuration DSL, and Java will implement core functionality. So I need some way to join Java and Groovy sources in one project.
I'm using maven for building, so it was natural to start searching plugin for maven. Well, after some minutes I have found Gmaven
First of all modify your pom.xml by adding Gmaven plugin

<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>

In order to make it compiling and running we need also groovy libraries

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.7.10</version>
</dependency>

The last thing to do is to create folders for groovy sources. Just make /src/main/groovy for sources and /test/main/groovy for tests

Thursday, July 1, 2010

Hello, world!

Это первый пост моего блога, который, в общем, совсем ни о чем. Я имею в виду пост - сам блог будет посвящен программированию вообще и языку Java в частности. Правда вполне возможно, что будет здесь место и для всяких размышлизмов и наблюдений в других плоскостях.
Немного о себе: я Java-разработчик с почти 6-летним стажем, разрабатываю в основном web-приложения. Блог о Java завел скорее всего чтобы систематизировать накопленный опыт и поделиться им, а также дабы отмечать новые находки в области программирования.
Комментирующим, ежели такие вдруг появятся, адресую просьбу не стесняясь исправлять ошибки и критиковать изложенное. Буду рад, если какие-то из материалов пригодятся кому-либо.
Ну, думаю для вступления вполне достаточно :)