-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Dependencies with RELEASE as version cannot be resolved (in 6.3.2) #3721
Comments
This is atypical use of an invalid version number (no longer supported in Maven 3: https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibility+Notes#Maven3.xCompatibilityNotes-PluginMetaversionResolution) , The dependency resolution was improved/fixed in 6.3.2: jeremylong/DependencyCheck#3627 |
org.apache.maven.plugins:maven-dependency-plugin:3.2.0:resolve works fine. |
@mprins the 'no longer supported' is for using it as a version for plugins. |
Using RELEASE for a plugin yields
Whereas using RELEASE for a dependency yields
|
@aikebah Sure, normally I wouldn't use RELEASE because, as you say, "reproducible builds", but as I said before, this particular application is there just for monitoring issues in commonly used internal and external depenendencies, so the "ontwikkelstraat" can monitor vulnerabilities in a single location. |
@aikebah would this be resolved with the recent updates you made? |
@jeremylong should be resolved by my issue-3721 branch, but had troubles creating a working IT. Think I nailed the issue (invoker runs fail with resolutionException while regular |
Hello It seems the problem still occurs when checking for a dependency declaring a sub-dependency with a RELEASE or LATEST metaversion. Exemple, for project AAAA having dependency BBBB with RELEASE metaversion referencing dependency YYYY also with RELEASE metaversion we get the error : DependencyNotFoundException: Expected dependency not found in resolved artifacts for dependency XXXX:YYYY:jar:RELEASE:compile of project-artifact AAAA When the sub-dependency BBBB is declared directly in the project AAAA (for exemple with scope provided) there is no more error thrown, so it clearly doesn't fail anymore for dependencies with RELEASE metaversion but still fail on subdependencies with RELEASE metaversion. So today we are referencing all RELEASE subdependencies directly in our project pom.xml with scope set to provided as a palliative measure to make things work. Thank you very much. |
@YSavanier Thanks for mentioning it. Created a separate issue for the case of transitive RELEASE/LATEST metaversion case for transitive dependencies. |
Dependencies with RELEASE as version cannot be resolved (since 3.6.2)
My department supports all Java application teams in my organisation. To this end my department has created an "application" that contains dependencies that are commonly used in our Java projects. This application creates a daily report with the OWASP dependency check. Some of these dependencies are internally developed components. For the external libraries/frameworks we're using version ranges in the pom.xml, for the internal components we're using the RELEASE tag, so we're always looking at the latest version.
Since version 6.3.2 we're getting resolution exceptions for dependencies that use the RELEASE tag:
Failed to resolve dependency nl.belastingdienst.jacob:jacob-business-calendar:jar:8.1.2-2 with dependencyResolver
exception: org.owasp.dependencycheck.exception.DependencyNotFoundException: Failed to resolve dependency nl.belastingdienst.jacob:jacob-business-calendar:jar:8.1.2-2 with dependencyResolver
org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.collectMavenDependencies(BaseDependencyCheckMojo.java:1334)
org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.collectDependencies(BaseDependencyCheckMojo.java:1467)
org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.scanArtifacts(BaseDependencyCheckMojo.java:1114)
org.owasp.dependencycheck.maven.AggregateMojo.scanDependencies(AggregateMojo.java:69)
org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.runCheck(BaseDependencyCheckMojo.java:1719)
org.owasp.dependencycheck.maven.BaseDependencyCheckMojo.execute(BaseDependencyCheckMojo.java:966)
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
If I replace the for one of those dependencies in a hardcoded version the resolution exception doesn't occur for that dependency.
This issue does not occur with 6.3.1 of dependency-check-maven.
Extract of the pom.xml (I removed parts for readability):
Version info:
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 1.8.0_292, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-37-generic", arch: "amd64", family: "unix"
I also tested this with Adopt OpenJDK 11, which gave the same results.
The text was updated successfully, but these errors were encountered: