Open sohrab- opened 6 years ago
To make this easier, I have created this sample project that replicates the issue.
This repo is checked out and run by a Seed Task with configuration identical to the screenshot in the last comment. This fails with the aforementioned exception.
I have placed the job's entire log in logs.txt
in that zip as well.
I've confirmed this also occurs on the latest version of the plugin.
Plugin version: 1.9.6 Bamboo version: 6.1.1 build 60104 - 10 Aug 17
Hi,
Please excuse my late reply!
I was able to reproduce this case. As far as I can see, it only happens with nested/inner classes. I think this could be related to https://stackoverflow.com/questions/27044522/groovy-importing-static-nested-classes
What do you think? Inner classes seam to be problematic in Groovy when accessed from scripts. Looks like they need to be precompiled...
Hi Michael
What was confusing me is that I had other nested enums that do work. I have now found out why.
In the sample code if you explicitly import dsls.BpmConfig
in BpmPlans.groovy
(even though not used there), the plan does pass.
It looks like there is a classloading issue (race condition?) and this way we can force the classloader to load the class prior to its use.
I have a rather strange issue and I am not certain what the root cause is. Basically when I reference certain classes or enums in my code, this works fine with local unit testing but on the SEED task I get compilation errors where the class cannot be resolved. I am wondering if there is a different class-loading approach in the SEED task that causes this issue.
Here is a simplified example:
src/main/groovy/dsls/XConfig.groovy
src/main/groovy/dsls/plans/XPlan.groovy
dsls/XPlans.groovy
This runs fine locally but on the SEED task it would cause the following issue:
Something that makes this even more confusing is that there are
YPlans
,YPlan
andYConfig
with the same setup that do compile fine.Here is the SEED task configuration:
I have tried all the different variations of import it the enum or its parent object or even doing fully qualified names but the error persists.