Skip to the content.

Java Build Manual

Prerequisites

Build Tools

We provided the necessary to build the project with either Maven or Gradle!

Please ensure that you have at-least one of them installed on your machine.

Java Version

The source code of this project is compatible with Java-8 and above. In the pom.xml and build.gradle, you can notice that the source version has been set to 1.8. Remember to change that configuration to your preferred version if needed.

IDEs

We are using IntelliJ, but you can choose any IDE that supports loading Maven or Gradle projects!

Process

Reminder: You need to run the commands below from the java folder!

To build and run the project, you can either use the build features in IntelliJ or the Maven & Gradle build command lines (as shown below):

IntelliJ

After loading the project into IntelliJ, you should be able to build the project using either the Maven or Gradle built-in build tools.

To run the application from IntelliJ, simply run the main method in the Application class.

The ‘Run’ tool window should display the following output:

****************************************************
*****************Application Report*****************
****************************************************

The total number of books sold is: 16
The total number of issued invoices is: 6
The total amount of all invoices in USD is: 424.57

****************************************************
****************************************************

Maven

Build Command

> mvn clean install 

If executed successfully, the above command should generate the following:

  1. The typical maven target folder
  2. The executable jar file MikadoTestBuilderKata under the target folder.

Run Command

To try out the application, run the command:

# Windows
  > java -jar target\MikadoTestBuilderKata.jar

# Mac & Linux
  > java -jar target/MikadoTestBuilderKata.jar

The following output should be generated:

****************************************************
*****************Application Report*****************
****************************************************

The total number of books sold is: 16
The total number of issued invoices is: 6
The total amount of all invoices in USD is: 424.57

****************************************************
****************************************************

Gradle

Build Command

# Option 1: Gradle is already installed on your machine 
> gradle clean build 

# Option 2: Gradle is NOT installed on your machine
# Windows  
> .\gradlew.bat clean build

# Mac & Linux
> ./gradlew clean build

If executed successfully, the above command should generate the following:

  1. The typical gradle build folder
  2. The executable jar file MikadoTestBuilderKata under the build/libs folder.

Run Command

To try out the application, run the command:

# Windows 
  > java -jar build\libs\MikadoTestBuilderKata.jar

# Mac & Linux 
  > java -jar build/libs/MikadoTestBuilderKata.jar

The following output should be generated:

****************************************************
*****************Application Report*****************
****************************************************

The total number of books sold is: 16
The total number of issued invoices is: 6
The total amount of all invoices in USD is: 424.57

****************************************************
****************************************************