Skip to content

Commit

Permalink
Add Micronaut and Quarkus support (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malax authored Oct 4, 2024
1 parent 8f29015 commit 332ece2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

* Add default process type for Micronaut and Quarkus. ([#224](https://github.com/heroku/heroku-buildpack-java/pull/224))

## [v73] - 2023-08-14

Expand Down
30 changes: 19 additions & 11 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@ EOF
fi

if [ ! -f $BUILD_DIR/Procfile ] && [ -d $BUILD_DIR/target ]; then
cd $BUILD_DIR
for jarFile in $(find target -maxdepth 1 -name "*.jar" -type f); do
if is_spring_boot $BUILD_DIR; then
echo "default_process_types:"
echo " web: java -Dserver.port=\$PORT \$JAVA_OPTS -jar $jarFile"
elif is_wildfly_swarm $BUILD_DIR; then
echo "default_process_types:"
echo " web: java -Dswarm.http.port=\$PORT \$JAVA_OPTS -jar $jarFile"
fi
break;
done
if is_quarkus $BUILD_DIR; then
echo "default_process_types:"
echo " web: java -Dquarkus.http.port=\$PORT \$JAVA_OPTS -jar target/quarkus-app/quarkus-run.jar"
else
cd $BUILD_DIR
for jarFile in $(find target -maxdepth 1 -name "*.jar" -type f -exec ls -S {} +); do
if is_spring_boot $BUILD_DIR; then
echo "default_process_types:"
echo " web: java -Dserver.port=\$PORT \$JAVA_OPTS -jar $jarFile"
elif is_wildfly_swarm $BUILD_DIR; then
echo "default_process_types:"
echo " web: java -Dswarm.http.port=\$PORT \$JAVA_OPTS -jar $jarFile"
elif is_micronaut $BUILD_DIR; then
echo "default_process_types:"
echo " web: java -Dmicronaut.server.port=\$PORT \$JAVA_OPTS -jar $jarFile"
fi
break;
done
fi
fi
14 changes: 13 additions & 1 deletion lib/frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ is_wildfly_swarm() {
test -n "$(grep "<groupId>org.wildfly.swarm" ${buildDir}/pom.xml)"
}

is_micronaut() {
local buildDir=${1:?}
test -f ${buildDir}/pom.xml &&
test -n "$(grep "<groupId>io.micronaut" ${buildDir}/pom.xml)"
}

is_quarkus() {
local buildDir=${1:?}
test -f ${buildDir}/pom.xml &&
test -n "$(grep "<groupId>io.quarkus" ${buildDir}/pom.xml)"
}

has_postgres() {
local buildDir=${1:?}
test -f ${buildDir}/pom.xml && (
test -n "$(grep "<groupId>org.postgresql" ${buildDir}/pom.xml)" ||
test -n "$(grep "<groupId>postgresql" ${buildDir}/pom.xml)" ||
test -n "$(grep "<groupId>com.impossibl.pgjdbc-ng" ${buildDir}/pom.xml)")
}
}

0 comments on commit 332ece2

Please sign in to comment.