JModel Sample Project

A Maven plugin to autogenerate a bunch of boilerplate code starting from a data model described in an XML file.

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

com.github.carlopantaleo
ArtifactId

ArtifactId

jmodel-sample-project
Last Version

Last Version

0.1.5
Release Date

Release Date

Type

Type

jar
Description

Description

JModel Sample Project
A Maven plugin to autogenerate a bunch of boilerplate code starting from a data model described in an XML file.

Download jmodel-sample-project

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.carlopantaleo/jmodel-sample-project/ -->
<dependency>
    <groupId>com.github.carlopantaleo</groupId>
    <artifactId>jmodel-sample-project</artifactId>
    <version>0.1.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.carlopantaleo/jmodel-sample-project/
implementation 'com.github.carlopantaleo:jmodel-sample-project:0.1.5'
// https://jarcasting.com/artifacts/com.github.carlopantaleo/jmodel-sample-project/
implementation ("com.github.carlopantaleo:jmodel-sample-project:0.1.5")
'com.github.carlopantaleo:jmodel-sample-project:jar:0.1.5'
<dependency org="com.github.carlopantaleo" name="jmodel-sample-project" rev="0.1.5">
  <artifact name="jmodel-sample-project" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.carlopantaleo', module='jmodel-sample-project', version='0.1.5')
)
libraryDependencies += "com.github.carlopantaleo" % "jmodel-sample-project" % "0.1.5"
[com.github.carlopantaleo/jmodel-sample-project "0.1.5"]

Dependencies

compile (10)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar
org.springframework.boot : spring-boot-starter-actuator jar
org.springframework.boot : spring-boot-starter-log4j2 jar
com.google.code.findbugs : jsr305 jar 3.0.2
org.hibernate : hibernate-core jar 5.3.7.Final
org.springframework : spring-orm jar 5.1.2.RELEASE
com.h2database : h2 jar 1.4.197
org.apache.tomcat : tomcat-dbcp jar 9.0.13
com.google.guava : guava jar 27.0-jre
com.github.carlopantaleo : jmodel-base-dao jar 0.1.5

test (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

JModel Maven Plugin

Build Status codecov

A Maven plugin to autogenerate a bunch of boilerplate code starting from a data model described in an XML file.

It generates:

  • Java entity classes
  • TypeScript entity classes
  • Hibernate mapping files

Please note: this plugin is in early development: it has not been extensively tested and most features are missing. DO NOT USE in production until version 1.0.0 will be released.

Please note (2): until version 1.0.0, we won't use semantic versioning (i.e. every new minor version could break backward compatibility).

Anyways, any contribution is well welcomed.

How to use

  1. Include the jmodel-maven-plugin in the plugins section of your POM. Configure the path of your jmodel.xml and jmodel-configuration.xml files and the project directory. Set the goals you need.

    <plugins>
        <plugin>
            <groupId>com.github.carlopantaleo</groupId>
            <artifactId>jmodel-maven-plugin</artifactId>
            <version>0.1.3</version>
            <configuration>
                <configurationFileName>${project.basedir}/src/main/resources/jmodel-configuration.xml</configurationFileName>
                <jmodelFileName>${project.basedir}/src/main/resources/jmodel.xml</jmodelFileName>
                <projectDir>${project.basedir}</projectDir>
            </configuration>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>generate-java-model</goal>
                        <goal>generate-hbm-files</goal>
                        <goal>generate-typescript-model</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
  2. Run mvn compile.

You can have a look at a working sample project at https://github.com/carlopantaleo/jmodel-maven-plugin/tree/master/jmodel-sample-project

XSDs

The latest XSDs for jmodel.xml and jmodel-configuration.xml can be found at the following links:

It's best to always use the XSDs related to the version of the jmodel-maven-plugin. In order to do so, just replace the desired version in the link:

TODOs

Internals

  • Replace the TemplateEngine with Jtwig.

Versions

Version
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1