forked from ShubhSik/Java-Quiz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
168 lines (162 loc) · 6.99 KB
/
pom.xml
File metadata and controls
168 lines (162 loc) · 6.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--This declares the Maven project using version 4.0.0 of the Maven model.
It sets up the structure and dependencies for the Quiz Game project. -->
<groupId>edu.sdccd.cisc190</groupId>
<artifactId>java-quiz-1</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<!-- groupId: Identifies the project's group (like a package name).
artifactId: A unique name for this project (java-quiz-1).
version: The version of the project (e.g., 1.0.0).
packaging: Specifies the output as a JAR file, which can run or distribute the project. -->
<name>Quiz Game</name>
<description>A beginner-level Quiz Game showcasing Java concepts.</description>
<url>https://github.com/ShubhSik/Java-Quiz</url>
<!-- Provides metadata about the project:
Name: "Quiz Game".
Description: Explains the purpose of the project.
URL: Link to the project repository (can be customized). -->
<properties>
<java.version>21</java.version> <!-- Update this if using a newer version -->
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<!-- Defines the Java version (e.g., 21) used for compiling the project.
Sets the Maven compiler plugin to match this Java version for both the source and target bytecode. -->
<dependencies>
<!-- JavaFX Dependency -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>22.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>22.0.2</version>
</dependency>
<!-- JUnit Dependency for Unit Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.11.2</version>
<scope>test</scope>
</dependency>
<!-- TestFX Core -->
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-core</artifactId>
<version>4.0.16-alpha</version>
<scope>test</scope>
</dependency>
<!-- TestFX JUnit -->
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-junit5</artifactId>
<version>4.0.16-alpha</version>
<scope>test</scope>
</dependency>
<!-- TestNG dependency -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.10.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- Adds dependencies required for the project:
JavaFX: Provides graphical user interface components.
JUnit: Supports writing and running unit tests (test scope means it's only used during testing). -->
<build>
<plugins>
<!-- Compiler Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- Configures the Maven Compiler Plugin:
Ensures the project is compiled using the specified Java version.
Uses Maven’s default settings for compatibility with the java.version property. -->
<!-- Ensure JUnit Platform is used for tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testing.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<!-- Maven Exec Plugin to Run JavaFX Application -->
<!-- Maven JAR Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
<mainClass>edu.sdccd.cisc190.Main</mainClass> <!-- Set your main class here -->
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>edu.sdccd.cisc190.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<!-- Configures the JavaFX Maven Plugin:
Allows running the JavaFX application directly using Maven.
Specifies the main class (edu.sdccd.cisc190.Main) as the entry point for the program. -->
<repositories>
<!-- Repository for JavaFX Dependencies -->
<repository>
<id>openjfx</id>
<url>https://openjfx.io/maven-repository/</url>
</repository>
</repositories>
<!-- Adds the OpenJFX Repository:
Ensures JavaFX libraries can be downloaded if not available in Maven’s central repository. -->
</project>
<!-- Purpose: The pom.xml file configures the Quiz Game project for Maven. It manages dependencies, compilers, plugins, and metadata.
Key Features:
Metadata: Defines project details (group ID, artifact ID, version, name).
Dependencies: Includes JavaFX for the GUI and JUnit for testing.
Compiler Configuration: Ensures compatibility with Java version 21.
JavaFX Plugin: Enables running the JavaFX application with Maven.
Custom Repository: Specifies OpenJFX for accessing JavaFX libraries.
In short, the pom.xml file automates the setup and management of the Quiz Game project, streamlining the build and run process. -->