Detection

migetpacks detects a Java application when any of the following files are present in the project root:
  • pom.xml (Maven)
  • build.gradle (Gradle, Groovy DSL)
  • build.gradle.kts (Gradle, Kotlin DSL)

Version Detection

Java version is resolved in the following priority order:

Version Normalization

Legacy version formats are normalized for Docker image compatibility:

Build Process

Build Tool Detection

migetpacks automatically detects the build tool:

Gradle Wrapper

If gradlew is present in the project root, migetpacks uses the Gradle Wrapper instead of the system Gradle for correct version compatibility.

Generated Dockerfile

For Gradle projects:

Run Command

The default run command depends on the build tool output:
Override with RUN_COMMAND or a Procfile:

JVM Configuration

The following environment variables are set for production:

Caching

Layer Caching

Dependencies are cached by copying build definition files before the full source:

BUILD_CACHE_DIR

When BUILD_CACHE_DIR is set, build tool caches persist at:

DHI Support

Docker Hardened Images are supported for Java builds.

DHI Notes

  • Eclipse Temurin DHI images do not include Maven or Gradle. Build tools are installed via apt-get in the builder stage.
  • Runtime images are distroless (no shell, no apt-get).
  • The nonroot user is used instead of the miget user.
  • Version normalization applies: 1.8 becomes 8, 1.11 becomes 11.

Example with DHI

Example

With build cache