You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to use compile group: 'org.apache.yetus', name: 'audience-annotations', version: '0.10.0' in a Gradle project. However, as can be seen here, it has a system-scoped optional dependency defined like this:
<dependencies>
<dependency>
<!-- Version and location set in project pom -->
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<scope>system</scope>
<!-- Mark as optional so that it isn't taken transitively -->
<optional>true</optional>
</dependency>
</dependencies>
The Problem: Because this is: a) a system-scoped and b) optional dependency, Gradle should not be trying to resolve it.
I have the following defined in my build.gradle file:
I was expecting this would take care of erasing the dependency from the dependency tree/graph.
However, it's still complaining with:
carlspring@carlspring:/java/opensource/gradle/possible-gradle-bug> gradle --no-daemon clean build
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve org.apache.yetus:audience-annotations:0.10.0.
Required by:
project :
> Could not resolve org.apache.yetus:audience-annotations:0.10.0.
> Could not parse POM https://repo1.maven.org/maven2/org/apache/yetus/audience-annotations/0.10.0/audience-annotations-0.10.0.pom
> Unable to resolve version for dependency 'jdk.tools:jdk.tools:jar'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
2 actionable tasks: 1 executed, 1 up-to-date
I don't think it should be attempting to resolve the dependency's pom, or validate it's coordinates in any way, as it's being told to exclude this dependency.
What more do I need to do in order to really exclude this dependency, which shouldn't actually be required, as I'm building the code using a JDK (1.8.0_144)?
I'm using Gradle 4.2.1, (not sure, if upgrading will be an option, unless it's a 4.x version).
I have a "Hello, World!" application illustrating this here.
Current Behavior
The system-scoped optional Maven dependency is not being excluded, like it's being told to.
Looks like this got fixed with Gradle 4.10.2 OR somewhere in between these two releases. I have tried running the Hello World , and that works fine with 4.10.2.
Environment:
Gradle 4.10.2
Build time: 2018-09-19 18:10:15 UTC
Revision: b4d8d5d
Kotlin DSL: 1.0-rc-6
Kotlin: 1.2.61
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_202
OS: Mac OS X 10.14.4 x86_64
Expected Behavior
I need to use
compile group: 'org.apache.yetus', name: 'audience-annotations', version: '0.10.0'
in a Gradle project. However, as can be seen here, it has asystem
-scopedoptional
dependency defined like this:The Problem: Because this is: a) a
system
-scoped and b)optional
dependency, Gradle should not be trying to resolve it.I have the following defined in my
build.gradle
file:I was expecting this would take care of erasing the dependency from the dependency tree/graph.
However, it's still complaining with:
I don't think it should be attempting to resolve the dependency's
pom
, or validate it's coordinates in any way, as it's being told to exclude this dependency.What more do I need to do in order to really exclude this dependency, which shouldn't actually be required, as I'm building the code using a JDK (
1.8.0_144
)?I'm using Gradle
4.2.1
, (not sure, if upgrading will be an option, unless it's a 4.x version).I have a "Hello, World!" application illustrating this here.
Current Behavior
The
system
-scopedoptional
Maven dependency is not being excluded, like it's being told to.Steps to Reproduce
Checkout this Hello, World! project and run:
Your Environment
See Also
The same thing occurs on Windows 10 as well with Gradle
4.2.1
.The text was updated successfully, but these errors were encountered: