miguno / java-docker-build-tutorial

A template project to create a minimal Docker image for a Java application. The example app uses Spring Boot to expose an HTTP endpoint.
Apache License 2.0
32 stars 255 forks source link

How to handle multimodule projects with Java 11? #1

Closed jkomyno closed 2 years ago

jkomyno commented 5 years ago

Thank you for your repository. For using Java11 instead of Java8, I'd suggest using maven:3.6-jdk-11-slim as image for the build stage, and then use openjdk:11.0.2-jdk-slim-stretch as image for the execution step. If you're interested I could open a PR that adds that.

However I'm doubtful about the correct approach with a multimodule maven project. Say that I have a parent pom.xml file and a number of first level submodules, each of which inherits that pom.xml. How should I structure the Dockerfile to build correctly? Right now I have an error like the following:

[FATAL] Non-resolvable parent POM for package:artifact_id:1.0-SNAPSHOT: Could not find artifact package:parent_artifact_id:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM
miguno commented 2 years ago

Closed because inactivity (sorry that I never had the chance to get back to this).