Skip to main content

Project to bring similar functionality found in Rails to the Spring Boot platform. Currently only supports maven-enabled projects.

For Example:

plaster g scaffold User name:string age:integer

Will create the following files:

  • Model - root/model/User.java

  • Repository - root/repository/UserRepository.java

  • Service - service/UserService.java

  • Controller - controller/UsersController.java

The root is calculated upon script start. For example, if being run on a project with the following in pom.xml:

<groupId>com.example</groupId>

the root will be src/main/com/example/

Installation

If you have pip installed, you can install Plaster with following:

pip install plaster-spring-boot

Otherwise, ensure Python’s setuptools is installed to install Plaster. If on an ubuntu system, use the following:

sudo apt-get install python-setuptools

Otherwise, explore setuptools to find how to install for your system. Then download Plaster onto your machine, navigate to the directory in which it was downloaded and run:

python setup.py install

Usage

usage: plaster [-h] [-v] [-k [KEY]] [-d DIR]
               {generate,g,delete,d}
               {scaffold,model,repository,service,controller,field} model_name
               [fields [fields ...]]

Generate files for Spring Boot

positional arguments:
  {generate,g,delete,d}
                        whether to generate or delete
                            generate, g - create files
                            delete, d - remove files
  {scaffold,model,repository,service,controller,field}
                        how to generate or delete content
                            scaffold - all files associated to the model
                            model - the entire model
                            repository - the entire repository
                            service - the entire service
                            controller - the entire controller
                            field - individual field(s)
  model_name            name of model for which to perform actions
  fields                fields to perform actions listed as name:type pairs

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         fetches the current version of the tool
  -k [KEY], --key [KEY]
                        indicates the following field:type pair should define the key
                        NOTE: should be a trailing param
  -d DIR, --dir DIR     defines a sub path in which to perform actions
                        NOTE: should be a trailing param

Customization

Per default, Plater will auto-discover necessary configurations and then use best-practices to decide where and how to generate files. However, if you would like to customize the generation of the files, Plater gives you the ability to alter defaults by placing plaster.yml in the root of the project. The following configurations are supported:

Property dir

Property

Description

Type

Default

model

Directory in which to generate models

String

model

repository

Directory in which to generate repositories

String

repository

controller

Directory in which to generate controllers

String

controller

service

Directory in which to generate services

String

service

Property lombok

Property

Description

Type

Default

enabled

Should we enable generation in lombok mode

Boolean

Is lombok a dependenc y in pom.xml ?

Lombok Support

Generation of models will change if a lombok dependency is found in pom.xml. This will import lombok and annotate the model differently. For example:

//NO LOMBOK
@Entity
public class Example {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

}
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@Builder
@Data
@NoArgsConstructor
public class Example {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

}

For lombok information, visit the project’s homepage.

Release files for plaster-spring-boot 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plaster-spring-boot 0.3.0
File Size Uploaded
plaster-spring-boot-0.3.0.tar.gz 13.8 kB Details

Release files / plaster-spring-boot-0.3.0.tar.gz

Download URL plaster-spring-boot-0.3.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2c21ee346f168b018d83463379d277c14b3dd418b93fb29d1713b58514883cae
BLAKE2b-256 checksum
How to use checksums
7429f21a5d9ae6c809a38601a5c1b81b23f37d98b378ce56e294356d57223b89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

0.1.18

1 release file

0.1.17

1 release file

0.1.16

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page