Skip to content

Commit 4a62014

Browse files
committed
Update the .gitignore and commit more files.
1 parent 641d0cf commit 4a62014

6 files changed

Lines changed: 558 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
target/
22
.idea/
33
*.iml
4-
mvnw
5-
mvnw.cmd
6-
.mvn/
74
/.settings/
85
*.log
96
*.class
107
out/
118
/.classpath
12-
/.project
13-
bin/
9+
/.project
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# bin helper scripts
2+
3+
This folder contains helper scripts included with generated projects. `dispatcher` is a small launcher
4+
script that helps run the generated application and can also extract the Maven wrapper if needed.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env sh
2+
3+
# Dispatcher script (copied from project root)
4+
ROOT="$(pwd)"
5+
VERSION="${tinystructVersion}"
6+
cd "$(dirname "$0")" || exit
7+
cd "../"
8+
# Navigate to the root directory
9+
cd "$ROOT" || exit
10+
11+
JAVA_OPTS=""
12+
args=""
13+
14+
for arg; do
15+
str=$(echo "$arg" | awk '{ string=substr($0, 0, 2); print string; }' )
16+
if [ "$str" = "-D" ] || [ "$str" = "-X" ]; then
17+
JAVA_OPTS="$JAVA_OPTS $arg"
18+
else
19+
args="$args $arg"
20+
fi
21+
done
22+
23+
JAR_FILE=""
24+
for jar_file in "$ROOT"/lib/tinystruct-"$VERSION".jar; do
25+
[ -f "$jar_file" ] && JAR_FILE="$JAR_FILE$jar_file:"
26+
done
27+
28+
$JAVA_HOME/bin/java \
29+
$JAVA_OPTS \
30+
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/ \
31+
-cp "$ROOT/target/classes:$CLASSPATH:$ROOT/WEB-INF/lib/*:$ROOT/WEB-INF/classes:$JAR_FILE" org.tinystruct.system.Dispatcher "$@"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@echo off
2+
REM Dispatcher Windows script (copied from project root)
3+
set "ROOT=%~dp0.."
4+
set "VERSION=${tinystructVersion}"
5+
6+
set "MAVEN_REPO=%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct"
7+
set "DEFAULT_JAR_FILE=%MAVEN_REPO%\%VERSION%\tinystruct-%VERSION%.jar"
8+
set "DEFAULT_JAR_FILE_WITH_DEPENDENCIES=%MAVEN_REPO%\%VERSION%\tinystruct-%VERSION%-jar-with-dependencies.jar"
9+
10+
if exist "%DEFAULT_JAR_FILE_WITH_DEPENDENCIES%" (
11+
set "JAR_PATH=%DEFAULT_JAR_FILE_WITH_DEPENDENCIES%"
12+
) else (
13+
set "JAR_PATH=%DEFAULT_JAR_FILE%"
14+
)
15+
16+
if "%JAVA_HOME%"=="" (
17+
echo Error: JAVA_HOME not found in your environment. >&2
18+
exit /B 1
19+
)
20+
21+
set "JAVA_CMD=%JAVA_HOME%\bin\java.exe"
22+
23+
if not exist "mvnw" (
24+
echo Maven Wrapper not found. Extracting from JAR...
25+
%JAVA_CMD% -cp "%JAR_PATH%" org.tinystruct.system.Dispatcher maven-wrapper --jar-file-path "%JAR_PATH%" --destination-dir "%ROOT%"
26+
if exist "%ROOT%\maven-wrapper.zip" (
27+
powershell -Command "Expand-Archive -Path '%ROOT%\\maven-wrapper.zip' -DestinationPath '%ROOT%'"
28+
del /F /Q "%ROOT%\maven-wrapper.zip"
29+
echo Maven wrapper setup completed.
30+
) else (
31+
echo Error: Maven wrapper ZIP file not found in JAR.
32+
exit /B 1
33+
)
34+
)
35+
36+
set "classpath=%ROOT%\target\classes;%ROOT%\lib\tinystruct-%VERSION%-jar-with-dependencies.jar;%ROOT%\lib\tinystruct-%VERSION%.jar;%ROOT%\lib\*;%ROOT%\WEB-INF\lib\*;%ROOT%\WEB-INF\classes;%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct\%VERSION%\tinystruct-%VERSION%-jar-with-dependencies.jar;%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct\%VERSION%\tinystruct-%VERSION%.jar"
37+
38+
%JAVA_CMD% -cp "%classpath%" org.tinystruct.system.Dispatcher %*

src/main/resources/archetype-resources/mvnw

Lines changed: 295 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)