[ 
https://issues.apache.org/jira/browse/GROOVY-11706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18003773#comment-18003773
 ] 

Xiaotian Ma commented on GROOVY-11706:
--------------------------------------

Thanks! I think the program here is legitimate, and the CLI compiler has not 
given any errors, so I firmly believe that there is a problem with the way my 
class loader is used. But I did use the FileSystemCompiler as you said. Is it 
because I am using JavaAwareCompilationUnit that this issue is occurring here? 
I can share you my Kotlin code that loading and creating these instances. You 
can see my code here 
[CrossLangFuzzer|https://github.com/XYZboom/CrossLangFuzzer/blob/master/runners/groovy-runner/src/main/kotlin/com/github/xyzboom/codesmith/groovy/GroovyCompilerUtils.kt#L73]

> How to run Groovy compiler via class loader without altering thread context 
> classloader?
> ----------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11706
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11706
>             Project: Groovy
>          Issue Type: Question
>          Components: Compiler
>            Reporter: Xiaotian Ma
>            Priority: Major
>         Attachments: screenshot-1.png
>
>
> When using direct reflection access to the main method of the 
> FileSystemCompiler class, some transformer classes do not seem to load 
> correctly. (The error is: Could not find class for Transformation Processor 
> org.codehaus.groovy.transform.trait.TraitASTTransformation declared by 
> groovy.transform.Trait)
> My original requirement was to use code instead of accessing multiple Groovy 
> compilers simultaneously from the command line. Since different versions 
> cannot coexist, I need to use classLoader to isolate them.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to