forked from nvdweem/PCPanel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
648 lines (617 loc) · 33.6 KB
/
Copy pathpom.xml
File metadata and controls
648 lines (617 loc) · 33.6 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.getpcpanel</groupId>
<artifactId>pcpanel</artifactId>
<version>${project.baseversion}${project.snapshot}</version>
<description>PCPanel controller software</description>
<properties>
<project.baseversion>2.0</project.baseversion>
<project.snapshot>-SNAPSHOT</project.snapshot>
<!--suppress UnresolvedMavenProperty -->
<github.build>${env.GITHUB_RUN_NUMBER}</github.build>
<!--suppress UnresolvedMavenProperty -->
<github.repo>${env.GITHUB_REPOSITORY}</github.repo>
<java.version>25</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.release>${java.version}</maven.compiler.release>
<start-class>com.getpcpanel.Main</start-class>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.34.1</quarkus.platform.version>
<maven.build.timestamp.format>yy.ww.WWkkmm</maven.build.timestamp.format>
<app.version>${project.baseversion}.${github.build}</app.version>
<windows.upgrade.uuid>9421bff0-3840-414c-8563-407fbcd1d04d</windows.upgrade.uuid>
<windows.vendor>PCPanel</windows.vendor>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jna.version>5.13.0</jna.version>
<asm.version>9.9</asm.version>
<dbus-java.version>5.2.0</dbus-java.version>
<lombok.version>1.18.44</lombok.version>
<typescript-generator.version>4.0.0</typescript-generator.version>
<mcp-server.version>1.13.0</mcp-server.version>
<!-- ── Native image: always build a native executable ─────────────── -->
<!-- Use -Dquarkus.native.enabled=false to skip native (JVM-only build) -->
<quarkus.native.enabled>true</quarkus.native.enabled>
<quarkus.native.graalvm-home>${env.GRAALVM_HOME}</quarkus.native.graalvm-home>
<!-- Include all charsets so JNA/Cp1252 (Windows native encoding) is available -->
<quarkus.native.add-all-charsets>true</quarkus.native.add-all-charsets>
<!-- Bundle all native DLLs/SOs: SndCtrl.dll (root), hidapi (win32-x86-64/), jnidispatch (com/sun/jna/...) plus runtime icon assets -->
<quarkus.native.resources.includes>SndCtrl.dll,**/*.dll,**/*.so,**/*.dylib,**/*.jnilib,assets/**,META-INF/services/javax.sound.midi.spi.MidiDeviceProvider</quarkus.native.resources.includes>
<!-- JNA, hid4java, jnativehook, and AWT-dependent classes must initialise at run time -->
<!-- Disable compressed oops in build JVM so Unsafe.arrayIndexScale(Object[].class) = 8, matching native image runtime.
Without this, jctools stores scale=4 (compressed oops) but native image uses 8-byte refs → segfault. -->
<!-- KEEP IN SYNC with application.properties' quarkus.native.additional-build-args.
NativeBuildArgsParityTest fails the build if the two arg lists diverge. -->
<quarkus.native.additional-build-args>
-Os,
-R:MaxHeapSize=67108864,
--initialize-at-run-time=com.getpcpanel.util.Kernel32Console,
--initialize-at-run-time=com.getpcpanel.cpp.linux.LinuxKeyboard$X11,
--initialize-at-run-time=com.getpcpanel.cpp.linux.LinuxKeyboard$XTest,
--initialize-at-run-time=com.getpcpanel.overlay.OverlayRenderer,
--trace-object-instantiation=java.security.SecureRandom,
-J-XX:-UseCompressedOops,--initialize-at-run-time=com.sun.jna,--initialize-at-run-time=org.hid4java,--initialize-at-run-time=com.fazecast.jSerialComm,--initialize-at-run-time=com.sun.media.sound,--initialize-at-run-time=javax.sound.midi.MidiSystem,--initialize-at-run-time=com.github.kwhat.jnativehook,--initialize-at-run-time=com.getpcpanel.commands.KeyMacro,--initialize-at-run-time=com.getpcpanel.iconextract.Shell32Extra,--initialize-at-run-time=com.getpcpanel.util.tray.win.WinShell32,--initialize-at-run-time=com.getpcpanel.util.tray.win.WinUser32Ext,--initialize-at-run-time=com.getpcpanel.sleepdetection.Win32Desktop,--initialize-at-run-time=com.getpcpanel.sleepdetection.Win32PowerNotify,--initialize-at-run-time=com.getpcpanel.sleepdetection.WindowsPowerEventMonitor,--initialize-at-run-time=com.getpcpanel.sleepdetection.LinuxX11$LibX11,--initialize-at-run-time=com.getpcpanel.sleepdetection.LinuxX11$LibXext,--initialize-at-run-time=com.getpcpanel.cpp.osx.CoreAudioLib,--initialize-at-run-time=com.getpcpanel.cpp.osx.CoreAudioLib$AudioObjectPropertyAddress,--initialize-at-run-time=com.getpcpanel.cpp.osx.CoreAudioLib$AudioObjectPropertyListenerProc,--initialize-at-run-time=com.getpcpanel.cpp.osx.OsxKeyboard$CoreGraphics,--initialize-at-run-time=com.getpcpanel.cpp.osx.OsxKeyboard$CoreFoundation,--initialize-at-run-time=com.getpcpanel.util.OsxPermissionHelper,--initialize-at-run-time=com.getpcpanel.util.OsxPermissionHelper$ApplicationServicesLib,--initialize-at-run-time=com.getpcpanel.util.OsxPermissionHelper$IOKitLib,--initialize-at-run-time=org.freedesktop.dbus,--initialize-at-run-time=com.getpcpanel.voicemeeter.VoicemeeterInstance,--initialize-at-run-time=com.getpcpanel.voicemeeter.VoicemeeterInstance$tagVBVMR_AUDIOINFO,--initialize-at-run-time=com.getpcpanel.voicemeeter.VoicemeeterInstance$tagVBVMR_AUDIOBUFFER,--initialize-at-run-time=com.getpcpanel.voicemeeter.VoicemeeterInstance$tagVBVMR_INTERFACE${native.awt.args}${native.platform.linker.args}
</quarkus.native.additional-build-args>
<!-- AWT/Java2D native-image initialization policy. This default value is the Linux build, which
(like macOS) bundles no libawt: the whole AWT/Java2D/Swing/ImageIO subsystem is deferred to
run-time init so native-image never runs an AWT static initializer or stores an AWT object in
the image heap during the build. The app never actually calls AWT on Linux (overlay no-op,
icons disabled, keystrokes via X11 XTEST, tray via D-Bus). The os-windows profile overrides
this with the non-headless windowing variant (Windows keeps quarkus-awt + headless Java2D).
The leading comma joins this onto the preceding arg; keep it as a single comma-separated list. -->
<native.awt.args>,--initialize-at-run-time=java.awt,--initialize-at-run-time=javax.swing,--initialize-at-run-time=sun.awt,--initialize-at-run-time=sun.lwawt,--initialize-at-run-time=sun.java2d,--initialize-at-run-time=sun.font,--initialize-at-run-time=javax.imageio,--initialize-at-run-time=com.sun.imageio,--initialize-at-run-time=com.getpcpanel.overlay.OverlayRenderer</native.awt.args>
<!-- Platform-specific native-image args, appended to the list above. Empty by default
(Linux/macOS); the os-windows profile injects the GUI-subsystem linker flags. The
leading comma joins it to the preceding arg; keep it empty (not blank lines) elsewhere. -->
<native.platform.linker.args></native.platform.linker.args>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Quarkus Core -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-scheduler</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-cache</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>log4j2-jboss-logmanager</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-websockets-next</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx</artifactId>
</dependency>
<!-- quarkus-awt is added only on Windows (see the os-windows-awt profile below): its native
build step unconditionally fails on macOS ("MacOS AWT integration is not ready") and GraalVM
has no libawt on macOS or Linux. Windows keeps headless Java2D (Win32 overlay + icon
extraction); macOS and Linux are AWT-free (overlay/icons disabled, keystrokes/tray via JNA/D-Bus). -->
<!-- Frontend via Quinoa -->
<dependency>
<groupId>io.quarkiverse.quinoa</groupId>
<artifactId>quarkus-quinoa</artifactId>
<version>2.8.0</version>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- FindBugs annotations -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<!-- Commons -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.18.0</version>
</dependency>
<!-- JNA for Windows audio control and Linux -->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>${jna.version}</version>
</dependency>
<!-- HID device communication -->
<dependency>
<groupId>org.hid4java</groupId>
<artifactId>hid4java</artifactId>
<!-- 0.8.0 bundles a darwin-aarch64 libhidapi.dylib; 0.7.0 shipped only the x86_64 darwin
lib, so HID device scanning failed on Apple Silicon ("incompatible architecture"). -->
<version>0.8.0</version>
</dependency>
<!-- Serial port access (Deej provider). Self-bundles native libs as classpath resources.
Pinned to 2.10.2: the last release before jSerialComm bundled its Android USB-serial
driver (added in 2.10.3). That mobile code references android.* SDK classes that are not
on a desktop classpath, which Quarkus's strict link-at-build-time native setting turns
into a hard native-image failure even though the Android path is dead for a desktop app.
We never run on Android, so we use the last Android-free version rather than stub it. -->
<dependency>
<groupId>com.fazecast</groupId>
<artifactId>jSerialComm</artifactId>
<version>2.10.2</version>
</dependency>
<!-- Stream utilities -->
<dependency>
<groupId>one.util</groupId>
<artifactId>streamex</artifactId>
<version>0.8.1</version>
</dependency>
<!-- ASM bytecode manipulation -->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>${asm.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<version>${asm.version}</version>
</dependency>
<!-- Global keyboard/mouse hooks -->
<dependency>
<groupId>com.github.kwhat</groupId>
<artifactId>jnativehook</artifactId>
<version>2.2.2</version>
</dependency>
<!-- OSC protocol -->
<dependency>
<groupId>com.illposed.osc</groupId>
<artifactId>javaosc-core</artifactId>
<version>0.8</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-reload4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- JetBrains annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>24.0.1</version>
</dependency>
<!-- MQTT client: Eclipse Paho mqttv5 — pure Java (no Netty/RxJava), keeps native footprint small -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.mqttv5.client</artifactId>
<version>1.2.5</version>
</dependency>
<!-- Expression evaluator for the Home Assistant dial "translate formula" — pure Java, no
reflection/native code, so it is native-image-safe out of the box. -->
<dependency>
<groupId>net.objecthunter</groupId>
<artifactId>exp4j</artifactId>
<version>0.4.8</version>
</dependency>
<!-- Parse the Home Assistant action YAML the user pastes (HA's native authoring format) into
the JSON body its REST API expects. Loaded with SafeConstructor (scalars/maps/lists only),
so no arbitrary-type reflection. -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.3</version>
</dependency>
<!-- D-Bus support for Linux Wayland system tray (StatusNotifierItem protocol) -->
<dependency>
<groupId>com.github.hypfvieh</groupId>
<artifactId>dbus-java-core</artifactId>
<version>${dbus-java.version}</version>
</dependency>
<dependency>
<groupId>com.github.hypfvieh</groupId>
<artifactId>dbus-java-transport-native-unixsocket</artifactId>
<version>${dbus-java.version}</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
</extension>
</extensions>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>application.properties</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<excludes>
<exclude>application.properties</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>cz.habarta.typescript-generator</groupId>
<artifactId>typescript-generator-maven-plugin</artifactId>
<version>${typescript-generator.version}</version>
<executions>
<execution>
<id>generate-websocket-typescript-contract</id>
<phase>compile</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<outputKind>module</outputKind>
<jsonLibrary>jackson2</jsonLibrary>
<outputFileType>implementationFile</outputFileType>
<mapEnum>asUnion</mapEnum>
<sortDeclarations>true</sortDeclarations>
<noFileComment>true</noFileComment>
<classPatterns>
<classPattern>com.getpcpanel.rest.model.**</classPattern>
<classPattern>com.getpcpanel.commands.Commands</classPattern>
<classPattern>com.getpcpanel.commands.command.**</classPattern>
<classPattern>com.getpcpanel.wavelink.command.**</classPattern>
<classPattern>com.getpcpanel.homeassistant.command.**</classPattern>
<classPattern>com.getpcpanel.device.descriptor.**</classPattern>
<classPattern>**.dto.**</classPattern>
</classPatterns>
<optionalAnnotations>
<optionalAnnotation>javax.annotation.Nullable</optionalAnnotation>
<optionalAnnotation>jakarta.annotation.Nullable</optionalAnnotation>
</optionalAnnotations>
<outputFile>${project.basedir}/src/main/webui/src/app/models/generated/backend.types.ts</outputFile>
</configuration>
</plugin>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>not-github-build</id>
<activation>
<property>
<name>!env.GITHUB_RUN_NUMBER</name>
</property>
</activation>
<properties>
<github.build>9999</github.build>
<github.repo>nvdweem/PCPanel</github.repo>
</properties>
</profile>
<profile>
<id>native</id>
<!-- Retained for backward compatibility (CI uses -Pnative explicitly). -->
<!-- All native-image properties now live in the main <properties> section. -->
</profile>
<profile>
<!-- Windows-only: link the native image as a GUI-subsystem executable so no console
window spawns on launch. /ENTRY:mainCRTStartup is required because /SUBSYSTEM:WINDOWS
otherwise makes the MSVC linker look for WinMain instead of main(). These are MSVC
linker flags, so they must NOT be passed on Linux/macOS (GNU ld / ld64 reject them);
hence this OS-activated profile rather than the shared <properties> block. -->
<id>os-windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<native.platform.linker.args>,-H:+UnlockExperimentalVMOptions,-H:NativeLinkerOption=/SUBSYSTEM:WINDOWS,-H:NativeLinkerOption=/ENTRY:mainCRTStartup,-H:-UnlockExperimentalVMOptions</native.platform.linker.args>
<!-- Windows runs HEADLESS Java2D. Both former reasons for non-headless AWT are gone:
the tray icon is a JNA Win32 Shell_NotifyIcon (TrayServiceWin) and the migration
prompt is a JNA User32 MessageBox (SaveService) - no Swing/SystemTray. headless=false
pulled in the full windowing toolkit (sun.awt.windows.WToolkit), whose libawt load
fails in the native image and bricks BufferedImage/ImageIO/icons/the overlay. Quarkus
supports headless AWT on Windows native; headless Java2D (overlay renderer + icon
extraction) is what we actually use. The leading comma joins this onto the preceding arg. -->
<native.awt.args>,-J-Djava.awt.headless=true,--initialize-at-run-time=java.awt,--initialize-at-run-time=sun.awt,--initialize-at-run-time=sun.font.FontManagerFactory,--initialize-at-run-time=sun.font.FontFamily,--initialize-at-run-time=sun.java2d.Disposer,--initialize-at-run-time=sun.java2d.d3d,--initialize-at-run-time=sun.java2d.windows,--initialize-at-build-time=java.awt.font.FontRenderContext,--initialize-at-build-time=sun.awt.SunHints,--initialize-at-build-time=sun.awt.SunHints$Value,--initialize-at-build-time=sun.awt.SunHints$LCDContrastKey,--initialize-at-build-time=sun.awt.SunHints$Key,--initialize-at-build-time=java.awt.Dimension,--initialize-at-build-time=java.awt.geom.Dimension2D</native.awt.args>
</properties>
<build>
<plugins>
<!-- jSerialComm cannot self-extract its bundled native lib inside a GraalVM native
image (it locates the jar via CodeSource, which is null there), so place the
Windows native lib next to the runner.exe. java.library.path includes the
executable's own directory, so SerialPort's System.loadLibrary("jSerialComm")
finds it - the same "companion DLL next to the binary" model as SndCtrl.dll.
build-installer.ps1 bundles target\*.dll into the installer. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>bundle-jserialcomm-native-windows</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.fazecast</groupId>
<artifactId>jSerialComm</artifactId>
<includes>Windows/x86_64/jSerialComm.dll</includes>
<outputDirectory>${project.build.directory}</outputDirectory>
<fileMappers>
<org.codehaus.plexus.components.io.filemappers.FlattenFileMapper/>
</fileMappers>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- AWT support (quarkus-awt) only on Windows, the one platform whose native image still
uses headless Java2D (the Win32 overlay renderer and process-icon extraction). macOS and
Linux have no libawt at all: their native images are AWT-free (overlay/icons disabled,
keystrokes/clipboard/tray via JNA or D-Bus), and quarkus-awt's native build step would
hard-fail on macOS. -->
<id>os-windows-awt</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-awt</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<!-- macOS native image: no libawt exists, so the whole AWT/Java2D/Swing/ImageIO subsystem is
initialized at run time (never at build time). The app never actually calls AWT on macOS
(overlay is a no-op, icons are disabled, keystrokes use CoreGraphics), so these classes
are deferred purely so native-image does not run their native static initializers during
the build. This replaces the build-time AWT pins used on Windows/Linux. -->
<id>os-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<native.awt.args>,--initialize-at-run-time=java.awt,--initialize-at-run-time=javax.swing,--initialize-at-run-time=sun.awt,--initialize-at-run-time=sun.lwawt,--initialize-at-run-time=sun.java2d,--initialize-at-run-time=sun.font,--initialize-at-run-time=javax.imageio,--initialize-at-run-time=com.sun.imageio,--initialize-at-run-time=com.getpcpanel.overlay.OverlayRenderer</native.awt.args>
</properties>
</profile>
<profile>
<!-- Regenerate GraalVM reachability metadata via the tracing agent. Runs the test suite
under -agentlib:native-image-agent in MERGE mode (keeps entries other platforms
captured) and enables the generation-only tests gated on pcpanel.generate-native-config
(e.g. LinuxKeyboardNativeConfigTest, which synthesises a real keystroke to load the
X11/XTest JNA libraries). Use a GraalVM JDK on a host that has the relevant native
libraries (and, for keystrokes, a live display):
mvn -Pnative-config-gen test -Dquarkus.native.enabled=false
Then strip any captured *Test infrastructure entries. See README. -->
<id>native-config-gen</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-agentlib:native-image-agent=config-merge-dir=${project.basedir}/src/main/resources/META-INF/native-image/ -Djava.awt.headless=false -Dpcpanel.generate-native-config=true</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Dev-only MCP server (com.getpcpanel.mcp). A Model Context Protocol server that exposes the
running app's runtime state and a hardware-free test harness to an agent. It is a DEVELOPER
affordance: it is compiled from a separate source root (src/mcp/java) and pulls in the
quarkus-mcp-server-sse extension ONLY when this profile is active, so the default build -
including the shipped GraalVM native image - never contains it (no native-image args, no
endpoint, nothing reaches end users). Enable it with -Dpcpanel.mcp=true, e.g.
`mvnw quarkus:dev -Dpcpanel.mcp=true`. The individual dev tools are gated again at runtime by
the build-time config flag `pcpanel.mcp.dev` (see application.properties), which is on in %dev. -->
<id>mcp</id>
<activation>
<property>
<name>pcpanel.mcp</name>
<value>true</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>io.quarkiverse.mcp</groupId>
<artifactId>quarkus-mcp-server-sse</artifactId>
<version>${mcp-server.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>add-mcp-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/mcp/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>