-
Notifications
You must be signed in to change notification settings - Fork 12
/
mvn.bat
99 lines (99 loc) · 4.38 KB
/
mvn.bat
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
:: This file is generated by build.xml
@echo off
setlocal enabledelayedexpansion
if not exist "%~dp0download\" (
mkdir "%~dp0download"
)
if not exist "%~dp0build\tmp\build\" (
mkdir "%~dp0build\tmp\build"
)
set DOWNLOAD_HELP=download https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2+13/OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip manually, move it to %~dp0download and restart this script
if not exist "%~dp0download\OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip" (
echo "In case of errors %DOWNLOAD_HELP%"
curl -f -o "%~dp0download\OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip.tmp" -L https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2+13/OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip
if !errorlevel! neq 0 (
echo "Please %DOWNLOAD_HELP%"
goto error
)
move "%~dp0download\OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip.tmp" "%~dp0download\OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip"
)
if not exist "%~dp0build\jdk-21.0.2+13\" (
tar --exclude=*/demo --exclude=*/sample --exclude=*/manual --exclude=*/src.zip -xvf "%~dp0download\OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip" -C "%~dp0build\tmp\build"
if !errorlevel! neq 0 (
echo "Please %DOWNLOAD_HELP%"
goto error
)
move "%~dp0build\tmp\build\jdk-21.0.2+13" "%~dp0build\jdk-21.0.2+13"
RUN_INSTALL="true"
)
set DOWNLOAD_HELP=download https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.10-bin.zip manually, move it to %~dp0download and restart this script
if not exist "%~dp0download\apache-ant-1.10.10-bin.zip" (
echo "In case of errors %DOWNLOAD_HELP%"
curl -f -o "%~dp0download\apache-ant-1.10.10-bin.zip.tmp" -L https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.10-bin.zip
if !errorlevel! neq 0 (
echo "Please %DOWNLOAD_HELP%"
goto error
)
move "%~dp0download\apache-ant-1.10.10-bin.zip.tmp" "%~dp0download\apache-ant-1.10.10-bin.zip"
)
if not exist "%~dp0build\apache-ant-1.10.10\" (
tar --exclude=*/demo --exclude=*/sample --exclude=*/manual --exclude=*/src.zip -xvf "%~dp0download\apache-ant-1.10.10-bin.zip" -C "%~dp0build\tmp\build"
if !errorlevel! neq 0 (
echo "Please %DOWNLOAD_HELP%"
goto error
)
move "%~dp0build\tmp\build\apache-ant-1.10.10" "%~dp0build\apache-ant-1.10.10"
)
set DOWNLOAD_HELP=download https://github.com/mozilla/rhino/releases/download/Rhino1_7_14_Release/rhino-1.7.14.zip manually, move it to %~dp0download and restart this script
if not exist "%~dp0download\rhino-1.7.14.zip" (
echo "In case of errors %DOWNLOAD_HELP%"
curl -f -o "%~dp0download\rhino-1.7.14.zip.tmp" -L https://github.com/mozilla/rhino/releases/download/Rhino1_7_14_Release/rhino-1.7.14.zip
if !errorlevel! neq 0 (
echo "Please %DOWNLOAD_HELP%"
goto error
)
move "%~dp0download\rhino-1.7.14.zip.tmp" "%~dp0download\rhino-1.7.14.zip"
)
if not exist "%~dp0build\rhino1.7.14\" (
tar --exclude=*/demo --exclude=*/sample --exclude=*/manual --exclude=*/src.zip -xvf "%~dp0download\rhino-1.7.14.zip" -C "%~dp0build\tmp\build"
if !errorlevel! neq 0 (
echo "Please %DOWNLOAD_HELP%"
goto error
)
move "%~dp0build\tmp\build\rhino1.7.14" "%~dp0build\rhino1.7.14"
)
if not exist "%~dp0build\apache-ant-1.10.10\lib\rhino-1.7.14.jar" (
del "%~dp0build\apache-ant-1.10.10\lib\rhino-*.jar"
copy "%~dp0build\rhino1.7.14\lib\rhino-*.jar" "%~dp0build\apache-ant-1.10.10\lib\"
)
set JDK_8_DIR=%~dp0%build\jdk8u392-b08
set JDK_11_DIR=%~dp0%build\jdk-11.0.21+9
set JDK_17_DIR=%~dp0%build\jdk-17.0.8+7
set JDK_21_DIR=%~dp0%build\jdk-21.0.2+13
if not exist "%JDK_8_DIR%" (
set RUN_INSTALL=true
)
if not exist "%JDK_11_DIR%" (
set RUN_INSTALL=true
)
if not exist "%JDK_17_DIR%" (
set RUN_INSTALL=true
)
if not exist "%~dp0build\apache-maven-3.9.6" (
set RUN_INSTALL=true
)
rem Maven will by default use 1.8 for source and target (independent of Java version being used to run Maven)
rem For example java 11 can be specified in the pom.xml of your project by adding property <maven.compiler.release>11</maven.compiler.release>
set JAVA_HOME=%JDK_21_DIR%
set ANT_HOME=%~dp0build\apache-ant-1.10.10
if "%RUN_INSTALL%" == "true" (
call "%~dp0build\apache-ant-1.10.10\bin\ant" -emacs -buildfile "%~dp0build.xml" install
)
call "%~dp0build\apache-maven-3.9.6\bin\mvn.cmd" %*
if %errorlevel% equ 0 goto end
:error
rem https://superuser.com/questions/527898/how-to-pause-only-if-executing-in-a-new-window
set arg0=%0
if [%arg0:~2,1%]==[:] if not [%TERM_PROGRAM%] == [vscode] pause
exit /b %errorlevel%
:end