Hi,
How can we Import a java jar on jenkins in order to allow a Groovy Script
part of a Job DSL to use java classes packaged within the jar file ?
Example of groovy script using the Java class Hello and method "message"
package groovy
import dev.snowdrop.jenkins.Hello;
println new Hello().mess
Hi Charles,
I think you can do this using the third party library @Grab [1]. I have
taken a look in the documentation of Grape [2] and I see they use a custom
Maven repository to load the libraries.
[1]
https://www.jenkins.io/doc/book/pipeline/shared-libraries/#using-third-party-libraries
[2]
htt
How about shared libraries?
https://www.jenkins.io/doc/book/pipeline/shared-libraries/
On Mon, Dec 14, 2020 at 10:55 AM Charles Moulliard
wrote:
> Hi,
>
> How can we Import a java jar on jenkins in order to allow a Groovy Script
> part of a Job DSL to use java classes packaged within the jar fi
Sorry, missed the part about JobDSL. I found a plugin which makes that
possible: https://github.com/AOEpeople/gradle-jenkins-job-dsl-plugin
With regards,
Nick Stolwijk
~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling tha
As per the documentation @grap is an option but it is not recommended.
You should either create a shared library or call `sh java jar...` and it
all depends on what you need.
On Mon, Dec 14, 2020 at 11:12 AM Yeikel wrote:
> How about shared libraries?
>
> https://www.jenkins.io/doc/book/pipelin
The approach you propose is only supported if you create Pipeline Jobs.
On Monday, December 14, 2020 at 5:12:04 PM UTC+1 Nick Stolwijk wrote:
> Hi Charles,
>
> I think you can do this using the third party library @Grab [1]. I have
> taken a look in the documentation of Grape [2] and I see they
Same remark as before. The approach you propose is only supported if you
create Pipeline Jobs.
On Monday, December 14, 2020 at 5:13:17 PM UTC+1 yeik...@gmail.com wrote:
> How about shared libraries?
>
> https://www.jenkins.io/doc/book/pipeline/shared-libraries/
>
> On Mon, Dec 14, 2020 at 10:55
Hi,
In a shared library, in a groovy script in /vars, the following code is
working perfectly:
String call(String stageName) {
String cowMsg = libraryResource 'cow.txt'
if (cowMsg != null) {
def vars = [:]
vars['MESSAGE'] = "BEGIN STAGE: ${stageName}"
def engine = new StreamingTe
I have a shared library which reads parameters from the jenkinsfile so here
is the important snippet of the shared library (
*defaultCiPipelineGeneric.groovy*)
def call(body) {
// evaluate the body block, and collect configuration into the object
def pipelineParams= [:]
body.resolveStr
HI All,
I am using MSBILD plugins for compiling C# code in jenkins & using solution
file I am compiling C# code, but if I run multiple solution file in 1 job &
in case 1 solution file getting error and all are successful then build
showing successful instead of failure. I am attaching screensho
10 matches
Mail list logo