Prerequisites
Before building the application, ensure you have the following installed:Java Development Kit (JDK) 21
The project requires Java 21 or later. Verify your installation:The output should show version 21 or higher.
The project uses Maven’s compiler plugin version 3.13.0 configured for Java 21 source and target compatibility.
Cloning the Repository
Clone the project repository to your local machine:Project Structure
The project follows Maven’s standard directory layout:Dependencies
The project uses the following main dependencies:- SQLite JDBC (3.41.2.1): Database connectivity
- JUnit Jupiter (5.10.0): Testing framework (test scope)
- JCalendar (1.4): Date picker components
Building the Application
Clean Build
To perform a clean build, removing any previous build artifacts:Compile Source Code
To compile the source code without running tests:Package the Application
To create both a standard JAR and a fat JAR with all dependencies:- Compile the source code
- Run tests (if present)
- Create a standard JAR in
target/ - Create a fat JAR with all dependencies using the Maven Shade Plugin
The Maven Shade Plugin is configured to create an executable JAR that includes all dependencies (SQLite JDBC, JCalendar) bundled together.
Skip Tests During Build
If you need to build without running tests:Build Output
After a successful build, you’ll find the following in thetarget/ directory:
Running the Application
From Fat JAR
The recommended way to run the application is using the fat JAR:From Maven
Alternatively, you can run directly using Maven:Maven Plugins Configuration
Compiler Plugin
Configured for Java 21 compilation:JAR Plugin
Creates a standard JAR with manifest entry for the main class:Shade Plugin
Creates an executable fat JAR with all dependencies:Troubleshooting
Build Failures
Java Version Mismatch
If you see compilation errors about language level:Ensure you’re using JDK 21 or later:
Missing Main Class
If you encounter errors about missing main class when running the JAR:Database File Not Found
The application expects the SQLite database file. Ensure your database is properly configured in theinput/ directory or as specified in the application configuration.
Build Lifecycle
Maven executes the following phases duringmvn package:
- validate: Validates the project structure
- compile: Compiles source code
- test: Runs unit tests with JUnit
- package: Packages compiled code into JAR
- shade: Creates fat JAR with dependencies
The shade plugin is bound to the package phase and automatically executes when you run
mvn package.