0

I know using Groovy, Jenkins Pipeline Shared library can be developed.

I want to know if there is any way the same Jenkins pipeline shared library can be developed using Java or any other technology?

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328

1 Answers1

2

You build groovy shared library and import your Java library by using Grab. See example how to import yaml library:

@Grab(group = 'org.yaml', module='snakeyaml', version = "1.18")
import org.yaml.snakeyaml.Yaml

Be sure that library jar file in Jenkins classpath. Works for me with Jenkins 2.150.1

ozlevka
  • 1,988
  • 16
  • 28