Using Groovy to implement a Service Interface

As groovy is the language of my choice, i would be interested, if it is possible to use Groovy for doing an Implementation of a Service like:


MyServiceBean.groovy
-------------------------------
class MyServiceBean implements MyService {
    @Override
    String myMethod() {
        println "hello World" 
    }}

Trying to do this, did not seem to work when executing. It says the following:


IllegalArgumentException: Service app-core/test_MyService is not registered in LocalServiceDirectory

In the Controller Layer a Groovy File works as expected. Can anybody give me a hint? That would be great.
Bye,
Mario

Mario, thanks for your question. You need to configure groovy for your core module in build.gradle file, which is located in root directory of the project. In the section configure(coreModule) add:

 
apply (plugin: "groovy") 
sourceSets { 
  main { groovy { srcDirs = ["src"] } } 
  test { groovy { srcDirs = ["test"] } } 
} 


thx, that did the trick!

bye