-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.cmd
31 lines (25 loc) · 912 Bytes
/
run.cmd
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
@echo off
REM SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
REM SPDX-License-Identifier: Apache-2.0
REM Author: Sebastian Thomschke, Vegard IT GmbH
for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "JAVA_MAJOR_VERSION=%%j"
if %JAVA_MAJOR_VERSION% LSS 17 (
echo ERROR: Java 17 or higher must be on PATH.
exit /b
)
if exist "_LOCAL\env.cmd" (
call _LOCAL\env.cmd
)
if not exist target\classes (
mvn -Pfast-build compile
)
:: run within maven JVM process
::mvn org.codehaus.mojo:exec-maven-plugin:java ^
:: -Dexec.mainClass="com.vegardit.copycat.CopyCatMain" ^
:: -Dexec.classpathScope=runtime ^
:: -Dexec.args="%*"
:: run in new JVM process
mvn org.codehaus.mojo:exec-maven-plugin:exec ^
-Dexec.classpathScope=runtime ^
-Dexec.executable="java" ^
-Dexec.args="-XX:+HeapDumpOnOutOfMemoryError -cp %%classpath com.vegardit.copycat.CopyCatMain %*"