Newer
Older
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Major project properties -->
<groupId>no.uib.inf101.terminal</groupId> <!-- must match package of Main class -->
<artifactId>INF101ShellLab</artifactId>
<name>INF101 Shell Lab</name>
<packaging>jar</packaging>
<properties>
<!-- General project properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<!-- Properties required for packaging application as JAR and installer -->
<app.main.class>${groupId}.Main</app.main.class> <!-- name of main class -->
<app.vendor>Torstein Strømme</app.vendor> <!-- replace with your name -->
<app.version>1.0.0</app.version> <!-- version displayed in "about" -->
<app.installer.macosx.type>dmg</app.installer.macosx.type> <!-- dmg, pkg -->
<app.installer.windows.type>msi</app.installer.windows.type> <!-- msi, exe -->
<app.macosx.icon.path>src/main/logo/macosx/logo.icns</app.macosx.icon.path>
<app.windows.icon.path>src/main/logo/windows/logo.ico</app.windows.icon.path>
<!-- Library and plugin versions -->
<junit.version>5.9.1</junit.version>
<maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>
<maven.dependency.plugin.version>3.4.0</maven.dependency.plugin.version>
<maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
<maven.surefire.plugin.version>3.0.0-M5</maven.surefire.plugin.version>
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
<exec.maven.plugin.version>1.6.0</exec.maven.plugin.version>
<!-- Computed properties -->
<maven.compiler.release>${java.version}</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.plugin.version}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/libs
</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>compile</includeScope>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin.version}</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${app.main.class}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
</dependency>
</dependencies>
</plugin>
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
</plugins>
</build>
<profiles>
<profile>
<id>build-mac</id>
<activation>
<os><family>mac</family></os>
</activation>
<build>
<plugins>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>${exec.maven.plugin.version}</version>
<executions>
<execution>
<id>Build Native Mac App</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<workingDirectory>${project.basedir}</workingDirectory>
<executable>./make/build_app_mac.sh</executable>
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<environmentVariables>
<APP_PACKAGE>${project.groupId}</APP_PACKAGE>
<ABOUT_NAME>${project.name}</ABOUT_NAME>
<APP_VENDOR>${app.vendor}</APP_VENDOR>
<APP_VERSION>${app.version}</APP_VERSION>
<ICON_PATH>${app.macosx.icon.path}</ICON_PATH>
<INSTALLER_TYPE>${app.installer.macosx.type}</INSTALLER_TYPE>
<JAVA_HOME>${java.home}</JAVA_HOME>
<JAVA_VERSION>${java.version}</JAVA_VERSION>
<MAIN_CLASS>${app.main.class}</MAIN_CLASS>
<MAIN_JAR>${project.artifactId}-${project.version}.jar</MAIN_JAR>
<PROJECT_NAME>${project.name}</PROJECT_NAME>
<PROJECT_VERSION>${project.version}</PROJECT_VERSION>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>build-windows</id>
<activation>
<os><family>windows</family></os>
</activation>
<build>
<plugins>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>${exec.maven.plugin.version}</version>
<executions>
<execution>
<id>Build Native Windows App</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<workingDirectory>${project.basedir}</workingDirectory>
<executable>./make/build_app_windows.bat</executable>
<environmentVariables>
<APP_PACKAGE>${project.groupId}</APP_PACKAGE>
<APP_VENDOR>${app.vendor}</APP_VENDOR>
<APP_VERSION>${app.version}</APP_VERSION>
<ICON_PATH>${app.windows.icon.path}</ICON_PATH>
<INSTALLER_TYPE>${app.installer.windows.type}</INSTALLER_TYPE>
<JAVA_HOME>${java.home}</JAVA_HOME>
<JAVA_VERSION>${java.version}</JAVA_VERSION>
<MAIN_JAR>${project.artifactId}-${project.version}.jar</MAIN_JAR>
<MAIN_CLASS>${app.main.class}</MAIN_CLASS>
<PROJECT_NAME>${project.name}</PROJECT_NAME>
<PROJECT_VERSION>${project.version}</PROJECT_VERSION>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>