DU01 to be handed in before the 2nd exercise
Maven
Maven - using plugins
Use the project (game, desktop app) from last semester convert it into Maven project and add plugins to the Maven project to create a JAR package and a libs directory.
Use the project (game, desktop app) from last semester convert it into Maven and add plugins to the Maven project to create a JAR package and a libs directory. You need to use the maven-dependency-plugin and maven-jar-plugin. For example, take inspiration from the exercise assignment (lab 01).
Create a run(.bat or .sh) script to run the game/app.
Running the application
Modified command for game running
- Without modules (not case for JavaFX app): java -jar name_of_jar_file
- With modules: java --module-path name_of_your_jar_file.jar:name_of_folder_fith_dependencies -m your_module_name/your_main_class_full_name
- With modules example: java --module-path project-0.0.1-SNAPSHOT.jar:libs -m cz.vsb.project/cz.vsb.App
insert into script.
JLINK
Try creating a jlink package using the javafx-maven-plugin plugin. The maven-jlink-plugin plugin from the exercise does not work in combination with JavaFX libraries.
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<id>create-jlink-image</id>
<phase>package</phase>
<goals>
<goal>jlink</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>cz.vsb.fei.java2.jez04lab01/cz.vsb.fei.java2.jez04lab01.App --must be changed</mainClass>
</configuration>
</plugin>
Add dependencies
Add dependencies for Unit tests in Kelvin
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
Method of submission
Submit the homework solution to the Kelvin system as the "Java 2 - Homework 1 - Maven" assignment. Upload the entire contents of the src folder and the pom.xml (and run script) file to the system. Follow the attached video below.
The project will then be compiled and Unit Tests will be performed. Due to the nature of the project and the provisional testing use of the Kelvin system in the Java 2 course, do not despair in case of failure.
This is an auxiliary test, everything will still be evaluated manually. It is important to upload the files so that everything can be evaluated and analyzed for plagiarism. I believe this is a formality and all of you are creating your own code.