GoogleContainerTools / GoogleContainerTools/jib
Jib creates invalid classpath entries if Maven dependency is of type pom
- Dominant language
- Java
- Stars
- 14.5k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Environment**:
- 3.2.1
- Maven
- OSX
**Description of the issue**:
Given the setup of a multimodule project, where there are maven modules without code but with dependencies, so that they encapsulate a set of runtime dependencies. Let's call them dependencyaggregators.
If an application module has a dependency with type `pom` to a sibling project and if the maven process is started at the root of the multimodule project. Jib will package the pom of the dependencyaggregator with an added "jar" extension into the image and into the classpathlist. If the application project is build directly, the `pom.xml.jar` will not be packaged.
When the application is a spring boot tomcat application, the tomcat classpath scanner will complain, because the `pom.xml.jar` artifact is no archive that can be scanned.
The issue from my perspective is, that there is no filtering on packaging types that can be put into the classpath. Because we are talking here about artifacts from dependencies, it can only be package type `jar`, `war` but it could also be a zip file but that would not be standard maven. As a fix i would propose to filter `project.getArtifacts()` in the caller of `com.google.cloud.tools.jib.maven.MavenProjectProperties#classifyDependencies`.
Contributor guide
Assessment
This issue has not been assessed yet.