-1

I want to setup jenkins using the command-line only. I am successfully able to install plugins and configure jobs. So i've installed the maven-plugin using jenkins-cli but want to be able to configure it to say "Automatically install maven latest version" so that when the user triggers a build it will automatically go download maven and then use it just like it does using the GUI.

Any advice on how i can do this piece of configuration on the command-line (or scripted ideally) please?

skymoose
  • 103
  • 1
  • 1
  • 7
  • Sorry - you havent explained why you are choosing to downvote what seems to be quite a reasonable question and one to which i'd have appreciated a helpful answer rather than 2 downvotes without any reason – skymoose Feb 28 '16 at 18:48
  • I guess people downvoted your question for clarity reasons. What does "setup jenkins using the command-line only" mean? Jenkins is available as native packaging for various OS and also as Java archive .war which can be deployed to the container using usual java deployment process. You should re-word your question (may be with a sample)? – Devesh Feb 28 '16 at 20:53
  • I do consider this a clear and understandable question. Please rethink this downvote. – Torsten Feb 28 '16 at 22:32

2 Answers2

0

This option is not and should never be available for the reason that it destroys the concept of reproducible builds.

Changing the maven version deliberately may break the build at some future time for no apparent reason and will definitely startle your users then.

Please avoid this situation.

Torsten
  • 6,184
  • 1
  • 34
  • 31
0

Why not use maven wrapper instead, this way each project configures specifically which version of maven it needs and automatically downloads it.

https://github.com/takari/maven-wrapper https://github.com/takari/maven-wrapper/blob/master/README.md

abe
  • 331
  • 1
  • 6