asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
285 stars 120 forks source link

Type 'AsciidoctorTask' property 'logDocuments' is annotated with @Optional but that is not allowed for 'Console' properties. #600

Closed jaredsburrows closed 3 years ago

jaredsburrows commented 3 years ago

Gradle 7.0

Repro:

gradlew asciidoc

Error:

$ gradlew asciidoc
Configuration on demand is an incubating feature.

> Configure project :
You are using one or more deprecated Asciidoctor Gradle plugin features. To help with migration run with --warning-mode=all.

> Task :asciidoctor FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':asciidoctor' (type 'AsciidoctorTask').
  - Type 'AsciidoctorTask' property 'logDocuments' is annotated with @Optional but that is not allowed for 'Console' properties.

    Reason: This modifier is used in conjunction with a property of type 'Console' but this doesn't have semantics.

    Possible solution: Remove the '@Optional' annotation.

    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#incompatible_annotations for more details about this problem.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
1 actionable task: 1 executed
jaredsburrows commented 3 years ago

I ran the same command with --warning-mode=all:

Error + Warning:

$ gradlew asciidoc --warning-mode=all
Configuration on demand is an incubating feature.

> Configure project :
You are using one or more deprecated Asciidoctor Gradle plugin features.
These will be removed in 3.0 of these plugins.
To help you migrate we have compiled some tips for you based upon your current usage.
- Task: asciidoctor:
  - You have used 'setAttributes'. When upgrading you will need to: the behaviour of setAttributes will change when upgrading. You may decide to use the asciidoctorj.setAttributes that exists as a project or task extension instead
- org.asciidoctor.convert:
  - 'org.asciidoctor.convert' is deprecated. When you have time please switch over to 'org.asciidoctor.jvm.convert'.
  - jcenter() is no longer added by default. If you relied on this behaviour in the past, please add jcenter() to the repositories block.

The RepositoryHandler.jcenter() method has been deprecated. This is scheduled to be removed in Gradle 8.0. JFrog announced JCenter's shutdown in February 2021. Use mavenCentral() instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.0/userguide/upgrading_version_6.html#jcenter_deprecation

> Task :asciidoctor FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':asciidoctor' (type 'AsciidoctorTask').
  - Type 'AsciidoctorTask' property 'logDocuments' is annotated with @Optional but that is not allowed for 'Console' properties.

    Reason: This modifier is used in conjunction with a property of type 'Console' but this doesn't have semantics.

    Possible solution: Remove the '@Optional' annotation.

    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#incompatible_annotations for more details about this problem.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 848ms
1 actionable task: 1 executed

Resolution:

I then migrated from org.asciidoctor.convert to org.asciidoctor.jvm.convert.