I have a project with several groovy files, and I have several “tiny” classes that I want to put into a single file.
Basically, here is what I want:
Foo.groovy:
class Foo
{
Foo() { println "Foo" }
}
Bar.groovy:
class Bar
{
Bar() { println "Bar" }
}
class Baz
{
Baz() { println "Baz" }
}
script.groovy:
new Foo()
new Bar()
new Baz()
And then:
$ groovy ./script.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/tmp/script.groovy: 5: unable to resolve class Baz
@ line 5, column 1.
new Baz()
^
1 error
Any idea?
source
share