jbake-org / jbake-gradle-plugin

A Gradle plugin for JBake
Other
46 stars 21 forks source link

Problem running in powershell #66

Closed rdmueller closed 2 years ago

rdmueller commented 2 years ago

since today I get a strange error when I use the plugin from powershell (openjdk 11):

Execution failed for task ':bake'.
> A failure occurred while executing org.jbake.gradle.impl.JBakeWorkAction
   > Could not isolate value org.jbake.gradle.impl.JBakeWorkActionParameters_Decorated@2d333b36 of type JBakeWorkActionParameters
      > Failed to query the value of property 'configuration'.
         > java.lang.NullPointerException (no error message)

but jbake configuration is set https://github.com/docToolchain/docToolchain/blob/ng/scripts/generateSite.gradle#L27

and everything runs fine on linux. Any idea?

rdmueller commented 2 years ago

when I try to debug this task in IntelliJ, I get a

> Unable to store input properties for task ':bake'. Property 'configuration' with value '{asciidoctor.option.requires=asciidoctor-diagram, asciidoctor.attributes=[sourceDir=C:\Users\ralfd\.doctoolchain\docToolchain-2.0.4-dev/build/docs, source-highlighter=prettify@, imagesoutDir=C:\Users\ralfd\.doctoolchain\docToolchain-2.0.4-dev/build/docs/microsite/output/images@, imagesDir=[:]/images@, targetDir=C:\Users\ralfd\.doctoolchain\docToolchain-2.0.4-dev/build/docs, docDir=C:\Users\ralfd\.doctoolchain\docToolchain-2.0.4-dev, projectRootDir=C:\Users\ralfd\.doctoolchain\docToolchain-2.0.4-dev@]}' cannot be serialized.
aalmiray commented 2 years ago

What's the output of gradle --version?

rdmueller commented 2 years ago

very good question :-)

------------------------------------------------------------
Gradle 6.7.1
------------------------------------------------------------

Build time:   2020-11-16 17:09:24 UTC
Revision:     2972ff02f3210d2ceed2f1ea880f026acfbab5c0

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.2 (Oracle Corporation 11.0.2+9)
OS:           Windows 10 10.0 amd64

I already tried different JVMs. The funny thing is that the problem occurs only on my windows 11 machine. Not on my Windows 10 device.

I had the 'cannot be serialized' problem before but can't remember how I solved it. I tried to minimize and even remove the config section but this also didn't work.

Copied my project over to linux (WSL) and there it works. So I guess it is also not an encoding problem.

rdmueller commented 2 years ago

just upgraded gradle to 6.9.2 - same problem

rdmueller commented 2 years ago

I think I am getting closer and now have something more meaningful:

class org.apache.commons.configuration2.CompositeConfiguration cannot be cast to class org.apache.commons.configuration.Configuration (org.apache.commons.configuration2.CompositeConfiguration and org.apache.commons.configuration.Configuration are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @60b54888)

https://github.com/jbake-org/jbake-gradle-plugin/blob/e666b6c3153cafced343ee050cfc11c87271f862/src/main/groovy/org/jbake/gradle/impl/JBakeWorkAction.groovy#L44

So, somehow I create a CompositeConfiguration which cannot be cast to Configuration

(this time, I got this error on Linux)

rdmueller commented 2 years ago

Sorry, while checking things it seems that I mix up problems. The class cast problem seems to be due to the latest jbake release candidate.

rdmueller commented 2 years ago

found the problem. Quite interesting.

I had one configuration entry site.branch:null . When I remove it, everything works fine.

Difference between linux and powershell was, that the branch was set as environment variable in the linux system 😣

rdmueller commented 2 years ago

sorry, forgot to close this...