Global groovy shared library (package), having two classes, import B from A

12 views
Skip to first unread message

Martin Holeček

unread,
Jun 28, 2017, 6:46:16 PM6/28/17
to Jenkins Users
Hello!

Please, which is the correct way to use a class defined in another file in the same package?

I tried all the ways I could, but Iam getting "unexpected token: a @ line ... column ....".

Does the upper/lower case in file names (mmethodi.groovy/MMethodI.groovy) play a role?



File #1 - mmethodi.groovy: (just definitions of mmethodi)

package org.medicalc; public class mmethodi implements java.io.Serializable
...

File #2 - MBuildItem.groovy: (needs to use mmethodi)

package org.medicalc; import org.medicalc.mmethodi; import org.medicalc.*; public class MBuildItem implements java.io.Serializable
{
mmethodi xmeth;
...

Thanks!
Martin
Reply all
Reply to author
Forward
0 new messages