Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

lincolnluiz/simple-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Crud

Generate files in specific folders to representante your architecture.

To generate your files, create a new group, eg. API-BACKEND, define the templates , that are processed with single variable, the ENTITY; entity is the name your business object, like Product, Client, Order...

Run the command:

make --group API-BACKEND --entity Product

Get started

Maven
mvn install:install-file -DgroupId=com.github.lincolnluiz -DartifactId=simplecrud-maven-plugin -Dversion=1.0.0 -Dpackaging=maven-plugin -Dfile=simplecrud-maven-plugin-1.0.0.jar
<build>
    <plugins>
        <plugin>
            <groupId>com.github.lincolnluiz</groupId>
            <artifactId>simplecrud-maven-plugin</artifactId>
            <version>1.0.0</version>
            <configuration>
            	<setupFile>src/main/resources/simple-crud-setup.json</setupFile>
            </configuration>
        </plugin>
    </plugins>
</build>

All the SimpleCrud is configured by a json file, simple-crud-config.js by convention. This file can saved in your project, he define your groups and templates, below the sample:

[
   {
      "title":"api-backend",
      "rootPath":"src/main/java/",
      "templates":[
         {
            "templatePath":"../resources/templates/entidade.vm",
            "dest":"model/{{entity.lower}}/",
            "finalName":"{{entity}}.java"
         }
      ]
   }
]

This file instructs that you has:

  • A unique group called api-backend;
  • The root path src/min/java;
  • A list of templates;

Group

The section define a collection of templates, has two attributes:

  • Title: title of group, it is used eg. to execute him.
  • rootPath: Define the location for all operations of group.

Templates

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published