Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Micronaut and Quarkus support #224

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)")
}
}