Discussion:
How should I configure a Jenkins maven job that will implement the .mvn/extensions.xml?
Adam Hardy
2018-10-24 17:48:47 UTC
Permalink
Hi,

sorry if this is a basic question but I can't find a way to set up a
Jenkins job so that it will run a maven deploy.

The simple maven job bombs because it's a yam pom and maven needs the
io.takari.polyglot:polyglot-yaml extension, defined in the
.mvn/extensions.xml in the repo.

I figured I'd need to set up freestyle job, but then I can't figure out
whether I'd need to run a Jenkinsfile and where I should define that.

I guess I'm missing something - help appreciated!

Thanks,
Adam
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/57535916-22d0-4cd5-b7d0-3b013b626055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jan Monterrubio
2018-10-24 23:06:08 UTC
Permalink
Are you using the Freestyle Job or the Pipeline job? You mention
Jenkinsfile and freestyle in the same paragraph (which at least to me is a
bit confusing)

How do you run this locally? You should be able to use the same command
either through the Pipeline DSL in an ‘sh “command”’ block.

pipeline {

agent any

stages {

stage('Example') {

steps {

sh 'mvn clean deploy'

}

}

}

}
Post by Adam Hardy
Hi,
sorry if this is a basic question but I can't find a way to set up a
Jenkins job so that it will run a maven deploy.
The simple maven job bombs because it's a yam pom and maven needs the
io.takari.polyglot:polyglot-yaml extension, defined in the
.mvn/extensions.xml in the repo.
I figured I'd need to set up freestyle job, but then I can't figure out
whether I'd need to run a Jenkinsfile and where I should define that.
I guess I'm missing something - help appreciated!
Thanks,
Adam
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/57535916-22d0-4cd5-b7d0-3b013b626055%40googlegroups.com
<https://groups.google.com/d/msgid/jenkinsci-users/57535916-22d0-4cd5-b7d0-3b013b626055%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9JhwCa9TdRzQO7Ge4bZxRqBsSwvB_wLyTKnU%2BRnNUNU4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Adam Hardy
2018-10-29 11:25:38 UTC
Permalink
Thanks. I run it locally like this:

mvn clean deploy

Locally mvn can read the pom.yml because it loads the .mvn/extensions.xml
in the project directory first.

It looks like the Jenkins maven functionality just can't do this, judging
by your answer recommending the command line approach.

Is there anything on the horizon to add the functionality? Yaml really
makes the maven pom so much more readable, I'd hate to ditch it and I'm not
going to persuade other team members to change their poms over to yaml if
they can't use the straight-forward Jenkins freestyle or maven job types :(

Regards
Adam
Post by Jan Monterrubio
How do you run this locally? You should be able to use the same command
either through the Pipeline DSL in an ‘sh “command”’ block.
pipeline {
agent any
stages {
stage('Example') {
steps {
sh 'mvn clean deploy'
}
}
}
}
Post by Adam Hardy
The simple maven job bombs because it's a yam pom and maven needs the
io.takari.polyglot:polyglot-yaml extension, defined in the
.mvn/extensions.xml in the repo.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e7b5704-8dd1-4f11-89f9-a84ea808ebe0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...