Hi Everyone,
I’m trying to develop a Jenkins plugin using kotlin.
The entry point of a Jenkins plugin is a class which extends Recorder, when I add such class to my project I cannot compile it anymore. Here’s an example:
public class LastChangesPublisher : Recorder(), SimpleBuildStep {
override fun getRequiredMonitorService(): BuildStepMonitor? {
throw UnsupportedOperationException()
}
override fun perform(run: Run<*, *>, workspace: FilePath, launcher: Launcher, listener: TaskListener) {
throw UnsupportedOperationException()
}
}
the error I got is this:
[ERROR] Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class hudson.model.AbstractProject, unresolved supertypes: ParameterizedJob
class hudson.model.BuildableItem, unresolved supertypes: Task
class hudson.model.AbstractBuild, unresolved supertypes: Executable
class hudson.model.Project, unresolved supertypes: ProjectWithMaven
Although unresolved classes are on my classpath.
The log for mvn package command can be found here: http://pastebin.com/Vu9b31Yz
I’ve attached a sample project here last-changes-plugin.zip (186.6 KB)
Any help is appreciated.