Seems like external classes load into DSL scripts doesn't work.

3,375 views
Skip to first unread message

Taras Fog

unread,
Nov 21, 2016, 3:29:39 PM11/21/16
to job-dsl-plugin
Hi guys,

As described here it doesn't work for me at all:

It says:
Processing DSL script TEST_JOB_CLASSES_USAGE.groovy
ERROR: startup failed:
workspace:/jobs/TST/TEST_JOB_CLASSES_USAGE.groovy: 4: unable to resolve class helpers.JobHelper
 @ line 4, column 1.
   import helpers.JobHelper;
   ^

My class is in /jobs/helpers/JobHelper.groovy

And is called as follow:
import helpers.JobHelper;

Any thougts why it still doesn't see this class?
Can anyone please assist in resolution of this issue?

Victor Martinez

unread,
Nov 21, 2016, 5:06:55 PM11/21/16
to job-dsl-plugin
Hi Taras,

Can you please confirm if you set 'the Additional classpath' option in the Process Job DSLs build step pointing to the location of your class? Something like like 'jobs/**/*.groovy' should work

Cheers

Taras Fog

unread,
Nov 22, 2016, 5:29:14 AM11/22/16
to job-dsl-plugin
Hello Victor,

Thank you for your reply.

I have just tried to add an "additional class path" as you have mentioned. 

I tried "jobs/**/*.groovy", "jobs/helpers/*.groovy".
None of them doesn't work.

Issue is still the same:

workspace:/jobs/TST/TEST_JOB_CLASSES_USAGE.groovy: 4: unable to resolve class helpers.JobHelper
 @ line 4, column 1.
   import helpers.JobHelper;

Class is defined in /jobs/helpers/JobHelper.groovy script.

Here is how it is defined at the beginning:

package helpers

import javaposse.jobdsl.dsl.Job

/**
* Created by tklym on 17.11.16.
*/

public class JobHelper {

And here how DSL script which call it starts:

 package TST

//loading class for IDEA development :
import helpers.JobHelper;

Victor Martinez

unread,
Nov 22, 2016, 8:49:46 AM11/22/16
to job-dsl-plugin
My bad, you need to try only with 'jobs'

Sorry about that

Taras Fog

unread,
Nov 22, 2016, 9:24:56 AM11/22/16
to job-dsl-plugin
Thank you, Victor.

It worked like a charm.

You have made my day! :)
And saved a lot of time. 

Regards,
Taras.

Taras Fog

unread,
Nov 25, 2016, 5:25:57 AM11/25/16
to job-dsl-plugin
Hello Victor,

Sorry to disturb you.
I wonder if you could help me with the issue as follow:

Thank you in advance.

Regards,
Taras.
Reply all
Reply to author
Forward
0 new messages