-
Notifications
You must be signed in to change notification settings - Fork 644
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
NPE from Assembly plugin when POM packaging is used #1146
Comments
I have the same issue with d-m-p 0.30.0. Looks like it's related to https://issues.apache.org/jira/browse/MENFORCER-308 - I have the issue after add maven-enforce-plugin to my root pom. |
I was able to <plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.31.0</version>
<!-- ... -->
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies>
</plugin> |
@daniel-huss : Thanks for your feedback. Could you please raise a PR to update this dependency if you have time? |
Unfortunately, using version 3.1.1 breaks my build in a different way. The assembly plugin now reports an empty set of dependencies, which breaks
Removing the plugin
However, disabling our maven-enforcer-plugin execution has fixed the issue completely for me:
|
Experienced the same issue with docker-maven-plugin 0.40.2, fixed it by forcing the assembly plugin version to 3.1.1. |
@rohanKanojia do you think we would be able to update the assembly plugin without breaking something ? |
Signed-off-by: Rohan Kumar <[email protected]>
Signed-off-by: Rohan Kumar <[email protected]>
Bug is in docker-m-p - fixed in mentioned PR |
Default dependencies resolutions for Mojo is NONE. When Mojo doesn't explicit required dependencies resolutions - plugins executed before can have impact on build. Eg. maven-enforcer-plugin only requires dependencies collections. If we have only m-enforcer-p like in pom packaging, resolved artifacts are not downloaded. It can cause NPE in m-assembly-p for missing files. Fix #1146 Signed-off-by: Slawomir Jaranowski <[email protected]>
Description
We use d-m-p with assembly file and everything is working great if default JAR Maven packaging is used. However this Maven module is meant for building docker image only, it does not contain any code. Attempts to use
<packaging>pom</packaging>
to avoid warnings about missing sources result in NPE thrown from Assembly plugin (exception trace is below).The exception is thrown from code of Assembly plugin, but it can be used directly in modules with POM packaging - tested with version 3.1.0
Info
mvn -v
) : 3.5.2Exception trace
pom.xml
, removal of<packaging>pom</packaging>
line helps to avoid NPE, but adds warnings from maven-jar-pluginreferenced in pom.xml docker-assembly.xml
The text was updated successfully, but these errors were encountered: