Missing error location being reported with convention plugin #28677
Labels
a:bug
in:precompiled-script-plugin
re:comprehensibility
reasonable errors and warnings, clear dsl, mental overload
Current Behavior
When an error happens in a convention plugin, the error location is not correct, e.g.
But when running with
--stacktrace
we can see the origin of the codeThis stack has 3 main parts
the exception reporting, complaining about
InvalidPluginException
, this is pure gradlea
PluginApplicationException
cause about applyingfireplace.maven-publication
, the frames reveal it's happening withinfireplace.published-java-library.gradle.kts
at Fireplace_published_java_library_gradle$1.invoke(fireplace.published-java-library.gradle.kts:12)
the original cause, which happens to be
MissingValueException: Cannot query the value of this provider because it has no value available.
, we see in the frames this is happening withinfireplace.maven-publication.gradle.kts
.at Fireplace_maven_publication_gradle$2$2$2$1.execute(fireplace.maven-publication.gradle.kts:83)
Expected Behavior
The error message should have been something like
Note I'm mentioning the source from the last executed frames where the user code is executed. Not sure this is feasible but this definitely look more practical to have this information.
Also I added the exception name, as I think this is in general useful, (maybe not in this case, as the message and exception name carry the same info)
Context (optional)
The project when the issue happened was at this revision
https://github.com/bric3/fireplace/tree/38cc9dff521ce58837b8c93a54ff9b10f4bedfa1
Convention plugin are there
fireplace.published-java-library.gradle.kts
appliesfireplace.maven-publication.gradle.kts
.fireplace.published-java-library.gradle.kts
Steps to Reproduce
This happened in a specific revision and during release
https://github.com/bric3/fireplace/tree/38cc9dff521ce58837b8c93a54ff9b10f4bedfa1
But I believe something similar can be created with a convention plugin that applies another convention plugin.
Gradle version
8.7
Build scan URL (optional)
https://scans.gradle.com/s/oncepoqa3np46/console-log?anchor=284&page=1
Your Environment (optional)
It was a github runner (ubuntu latest).
The text was updated successfully, but these errors were encountered: