How It Works
JustNewModule is a tool designed to automate the creation of a project structure and essential files based on the Clean Architecture principles. Below is an explanation of its features and steps for usage.
Program Functionality
-
Dependency Check: The program scans the
pom.xml
file of your project to check if Lombok is present as a dependency. It also determines the name of the root package used in your project (e.g.,pl.iseebugs
). -
Directory Structure: The program creates directories according to the Clean
Architecture structure if they do not already exist:
infrastructure/
domain/
dto/
-
File Generation: For each directory, the program generates essential files pre-filled
with code:
SamplePort (interface):
Defines the contract for the application's core functionalities.SampleRepository:
Handles data persistence.SampleMapper:
Provides mapping between domain and DTO objects.SampleService:
Contains the core business logic.SampleController:
Exposes endpoints to external systems.SampleDTO:
A Data Transfer Object for API communication.SampleNotFoundException:
A custom exception for handling errors.
How to Run
- Copy the script (
jnm_1.jar
) into the root directory of your project. - Execute the script using the following command:
java -jar jnm_1.jar
Once executed, the program will:
- Check your project's structure and dependencies.
- Generate directories and files according to the Clean Architecture principles.
- Populate these files with boilerplate code to provide a quick starting point for your application.
This tool is designed to save time, reduce boilerplate, and help you kickstart your projects with a robust, maintainable architecture. For any issues or enhancements, please visit the GitHub repository linked in the footer.