-
Notifications
You must be signed in to change notification settings - Fork 90
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
NullPointerException when Maven-style exclusions are enabled and a dependency has a pom which Maven's Model Builder considers to be invalid #365
Comments
Thanks for the report. Looking at the build scan, I can see that the plugin's support for Maven-style exclusions encounters a problem when processing the pom for plugins {
id "java"
id "io.spring.dependency-management" version "1.1.2"
}
repositories {
mavenCentral()
}
dependencies {
implementation("eu.fraho.spring:security-jwt-base-spring-boot-starter:5.0.5")
} Running with
There's a similar problem with I suspect that this is now causing a failure due to an upgrade of the version of Maven's model builder that the dependency management plugin embeds. This upgrade was done to fix #350 and picked up the changes for MNG-6123. Please report the invalid poms to the maintainers of You can work around the failure that the invalid pom is now causing in the dependency management plugin by disabling Maven-style exclusions: dependencyManagement {
applyMavenExclusions = false
} I'll take a look at tolerating self-referential poms that Maven's model builder considers to be invalid. |
Thank you very much for analyizing this. I'm the maintainer of the mentioned artifact and I have no idea how / when the pom became invalid and why I didn't notice it earlier. // edit: ok, it broke with 4.3.0 (bratkartoffel/security-jwt@4.2.0...4.3.0). After digging in and analyzing the pom it seems, that the 'java-test-fixtures' plugin is causing the problem. As soon as I enable that plugin, the pom-file contains a self-reference. // edit-2: seems like I'm not the only one with that issue: https://stackoverflow.com/q/69877418 // edit-3: I've found a workaround to remove the self referential dependencies when using the testFixtures: bratkartoffel/security-jwt@48a7e84 |
We're also experiencing issues w/ the update from 1.1.1/1.1.2 (1.1.0 works fine). Initially it gives the same error @bratkartoffel got above, e.g.
But with --debug, we get the following:
EDIT: Related to eclipse-platform/eclipse.platform#180 |
Starting with Spring Dependency Management Plugin version 1.1.0, invalid POMs cause the plugin to fail. Unfortunately, Sonar has dependencies that have invalid POMs, and it doesn't appear that Sonar is going to change to use dependencies with valid POMs any time soon. Therefore, in order to continuing using the name.remal.sonarlint plugin, there are only two options: 1. Downgrade Sonar to a version that has dependencies all with valid POMs. That could be done by adding a dependency on: `sonarlintCorePlugins("org.sonarsource.java:sonar-java-plugin:7.18.0.31443")` However, it's not ideal to be stuck on an old version for an indeterminate amount of time. 2. Disable Spring Dependency Management Plugin's new maven exclusion semantics. There doesn't appear to be a downside for this project in doing so. See: spring-gradle-plugins/dependency-management-plugin#365 See: https://community.sonarsource.com/t/sonar-java-plugin-has-dependencies-with-invalid-poms/96334/6
Starting with Spring Dependency Management Plugin version 1.1.0, invalid POMs cause the plugin to fail. Unfortunately, Sonar has dependencies that have invalid POMs, and it doesn't appear that Sonar is going to change to use dependencies with valid POMs any time soon. Therefore, in order to continuing using the name.remal.sonarlint plugin, there are only two options: 1. Downgrade Sonar to a version that has dependencies all with valid POMs. That could be done by adding a dependency on: `sonarlintCorePlugins("org.sonarsource.java:sonar-java-plugin:7.18.0.31443")` However, it's not ideal to be stuck on an old version for an indeterminate amount of time. 2. Disable Spring Dependency Management Plugin's new maven exclusion semantics. There doesn't appear to be a downside for this project in doing so. See: spring-gradle-plugins/dependency-management-plugin#365 See: https://community.sonarsource.com/t/sonar-java-plugin-has-dependencies-with-invalid-poms/96334/6
Starting with Spring Dependency Management Plugin version 1.1.0, invalid POMs cause the plugin to fail. Unfortunately, Sonar has dependencies that have invalid POMs, and it doesn't appear that Sonar is going to change to use dependencies with valid POMs any time soon. Therefore, in order to continuing using the name.remal.sonarlint plugin, there are only two options: 1. Downgrade Sonar to a version that has dependencies all with valid POMs. That could be done by adding a dependency on: `sonarlintCorePlugins("org.sonarsource.java:sonar-java-plugin:7.18.0.31443")` However, it's not ideal to be stuck on an old version for an indeterminate amount of time. 2. Disable Spring Dependency Management Plugin's new maven exclusion semantics. There doesn't appear to be a downside for this project in doing so. See: spring-gradle-plugins/dependency-management-plugin#365 See: https://community.sonarsource.com/t/sonar-java-plugin-has-dependencies-with-invalid-poms/96334/6
Starting with Spring Dependency Management Plugin version 1.1.0, invalid POMs cause the plugin to fail. Unfortunately, Sonar has dependencies that have invalid POMs, and it doesn't appear that Sonar is going to change to use dependencies with valid POMs any time soon. Therefore, in order to continuing using the name.remal.sonarlint plugin, there are only two options: 1. Downgrade Sonar to a version that has dependencies all with valid POMs. That could be done by adding a dependency on: `sonarlintCorePlugins("org.sonarsource.java:sonar-java-plugin:7.18.0.31443")` However, it's not ideal to be stuck on an old version for an indeterminate amount of time. 2. Disable Spring Dependency Management Plugin's new maven exclusion semantics. There doesn't appear to be a downside for this project in doing so. See: spring-gradle-plugins/dependency-management-plugin#365 See: https://community.sonarsource.com/t/sonar-java-plugin-has-dependencies-with-invalid-poms/96334/6
Starting with Spring Dependency Management Plugin version 1.1.0, invalid POMs cause the plugin to fail. Unfortunately, Sonar has dependencies that have invalid POMs, and it doesn't appear that Sonar is going to change to use dependencies with valid POMs any time soon. Therefore, in order to continuing using the name.remal.sonarlint plugin, there are only two options: 1. Downgrade Sonar to a version that has dependencies all with valid POMs. That could be done by adding a dependency on: `sonarlintCorePlugins("org.sonarsource.java:sonar-java-plugin:7.18.0.31443")` However, it's not ideal to be stuck on an old version for an indeterminate amount of time. 2. Disable Spring Dependency Management Plugin's new maven exclusion semantics. There doesn't appear to be a downside for this project in doing so. See: spring-gradle-plugins/dependency-management-plugin#365 See: https://community.sonarsource.com/t/sonar-java-plugin-has-dependencies-with-invalid-poms/96334/6
Remove workaround as the name.remal.sonarlint plugin now works around the issue See: spring-gradle-plugins/dependency-management-plugin#365
io.spring.dependency-management:1.1.3 fixes this issue. See: spring-gradle-plugins/dependency-management-plugin#365
io.spring.dependency-management:1.1.3 fixes this issue. See: spring-gradle-plugins/dependency-management-plugin#365
io.spring.dependency-management:1.1.3 fixes this issue. See: spring-gradle-plugins/dependency-management-plugin#365
io.spring.dependency-management:1.1.3 fixes this issue. See: spring-gradle-plugins/dependency-management-plugin#365
Starting with Spring Dependency Management Plugin version 1.1.0, invalid POMs cause the plugin to fail. Unfortunately, Sonar has dependencies that have invalid POMs, and it doesn't appear that Sonar is going to change to use dependencies with valid POMs any time soon. Therefore, in order to continuing using the name.remal.sonarlint plugin, there are only two options: 1. Downgrade Sonar to a version that has dependencies all with valid POMs. That could be done by adding a dependency on: `sonarlintCorePlugins("org.sonarsource.java:sonar-java-plugin:7.18.0.31443")` However, it's not ideal to be stuck on an old version for an indeterminate amount of time. 2. Disable Spring Dependency Management Plugin's new maven exclusion semantics. There doesn't appear to be a downside for this project in doing so. See: spring-gradle-plugins/dependency-management-plugin#365 See: https://community.sonarsource.com/t/sonar-java-plugin-has-dependencies-with-invalid-poms/96334/6
io.spring.dependency-management:1.1.3 fixes this issue. See: spring-gradle-plugins/dependency-management-plugin#365
Hi,
after upgrading the plugin to the latest released version, 1.1.0 to 1.1.1, the build fails due to a NPE:
Buildscan available at: https://scans.gradle.com/s/6ygpyymluwloq
The repository with the sources is private, but I can give a maintainer access to it for analyzing.
Thanks,
bk
The text was updated successfully, but these errors were encountered: