Introduction

The CodeGenerator is a maven plugin that is used to generate code like grails. The difference versus grails is that any code is simple like you write, no scripting, no reflactions if aren't necessary.

This plugin don't generate directly code but use other plugins that you can configure to build your own application. For example you can add plugin to generate service with hibernate, controllers with DWR and simple html page with ajax, or you can build an application with ibatis services, ecc...

Configure

To use the code generator you must add the plugin in the build dependency:

  <build>
    <plugins>
        <plugin>
                <groupId>net.sourceforge.su4jd.maven.plugins</groupId>
                <artifactId>CodeGenerator</artifactId>
                <version>0.1</version>
                <configuration>
                        <packageName>it.test.cg_test</packageName>
                </configuration>
                <dependencies>
                        <dependency>
                                <groupId>net.sourceforge.su4jd.codegenerator.plugins</groupId>
                                <artifactId>service-ibatis</artifactId>
                                <version>0.1</version>
                        </dependency>
                        <dependency>
                                <groupId>net.sourceforge.su4jd.codegenerator.plugins</groupId>
                                <artifactId>spring-mvc-controller</artifactId>
                                <version>0.1</version>
                        </dependency>
                </dependencies>
        </plugin>
    </plugins>
  </build>
    

The packageName is the name of the principal package that contains subpackages controllers, services and entities.

In the dependencies you must add all the plugin of the code generator able to generate parts of code (service layers, view layers, and controllers layer).

Use

Now you can use the code generator.

How first step create