[
https://issues.apache.org/jira/browse/OFBIZ-10226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16929825#comment-16929825 ]
Mathieu Lirzin commented on OFBIZ-10226:
----------------------------------------
Hello [~jacques.le.roux],
In fact my idea is more or less already implemented in OFBiz, since Groovy code is compiled when present in {{src/main/java}} but not in {{groovyScripts}}.
I can explain the error you got very clearly. When a groovy script is compiled a Class is derived from it. When the script doesn't declare a package name it got assigned to the "default" package and when the script doesn't contains a class defintion, the class name is deduced from the script file name.
Since multiple scripts from different OFBiz plugins happen to have the same file name we ended up with name clash. The right solution is to define namespaces by adding a package statement like {{package org.apache.ofbiz.myPlugin}} in scripts.
> Adds groovyScripts in the Gradle sourceSets
> -------------------------------------------
>
> Key: OFBIZ-10226
> URL:
https://issues.apache.org/jira/browse/OFBIZ-10226> Project: OFBiz
> Issue Type: Improvement
> Components: Gradle
> Affects Versions: Trunk
> Reporter: Jacques Le Roux
> Assignee: Jacques Le Roux
> Priority: Major
>
> With the Eclipse Groovy Development Tools plugin installed, we can use the Eclipe debugger with Groovy files if we provide source paths for them. So we need to improve the sourceSets defined in the main build.gradle file.
>
--
This message was sent by Atlassian Jira
(v8.3.2#803003)