Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins
Apache License 2.0
1.66k
stars
116
forks
source link
synthesizeDependenciesMain is failing with exception when having a file collection with an absolute file on windows as dependency #1164
as a dependency, then the graph-compile-nodes.json has the absolute path as identifier.
Following that, the synthesizeDependenciesMain task fails with FileNotFoundException
because it tries to create the file build\reports\dependency-analysis\main\dependencies\C__\full\path\to\bar\baz.json where the intermediate C__\full\path\to\bar directories are not present which makes it fail.
Expected behavior
No exception, everything working.
Additional context
Generally, it is of course not a good idea to use files or fileTree as dependencies, but sometimes you do not have a real choice.
The reproducer is a highly condensed MCVE after trying to figure out what exactly makes it break for 2 days.
In the real project the com.klinec.gradle.javacard plugin is applied which adds such a dependency automatically and you cannot prevent it to do so.
Build scan link https://scans.gradle.com/s/2tj64rxgo5xsm
Plugin version 1.31.0
Gradle version 8.7
JDK version 11
Describe the bug If you have
as a dependency, then the
graph-compile-nodes.json
has the absolute path asidentifier
. Following that, thesynthesizeDependenciesMain
task fails withFileNotFoundException
because it tries to create the filebuild\reports\dependency-analysis\main\dependencies\C__\full\path\to\bar\baz.json
where the intermediateC__\full\path\to\bar
directories are not present which makes it fail.To Reproduce
Be on Windows and run
Expected behavior No exception, everything working.
Additional context Generally, it is of course not a good idea to use
files
orfileTree
as dependencies, but sometimes you do not have a real choice. The reproducer is a highly condensed MCVE after trying to figure out what exactly makes it break for 2 days. In the real project thecom.klinec.gradle.javacard
plugin is applied which adds such a dependency automatically and you cannot prevent it to do so.