Can maven prompt for username and password - maven-3

I am currently passing my password and username as arguments in maven command line. Is there any plugin available in maven to prompt for username and password while deploying to a server. I am using maven 3.3.9 version

I heave serached for myself for a long time for something similar, but I see only two possible solutions:
Write a maven plugin for this
Use Ant like explained in this similar stackoverflow answer

Related

Jenkins / Maven Release Plugin SVN - Credentials

I have Jenkins Version 2.89.4 with the actual MavenReleasePlugin and SVN as repository. The SVN - Credentials set in the project configuration will not be used from the MavenReleasePlugin as I am aware.
Do I press in Jenkins the Build Release Button, I may enter user and password for SVN. This works fine, but it is work interactive.
How and where can I store these credentials in the background in Jenkins or any settings.xml ? so that I don't have to enter the credentials each time I am building a release.
You tell maven NOT to work in interactive mode using
mvn -B release:prepare
or
mvn --batch-mode release:prepare
Using batch mode with no other configuration will cause the Release Plugin to use default values for the release version, the SCM tag, and the next development version. These values can also be set from the command line. So you can set in the command line the "-username" and "-password" arguments.
Another option is to create a properties file that contains the version information for the project you would like to release. In this property file you can place the username and password.
Read more here and here.
Hope that helps!

Adding Global passwords to Jenkins using groovy

Im provisioning my Jenkins using groovy, I need to configure Jenkins.
To be specific Manage Jenkins - configure system
Like Global password, Gitlab configuration and Project configuration.
I'm new to groovy I have very less knowledge on groovy.
It would be really helpful if anyone can share groovy script to configure Jenkins?!
this is a great idea , I just did the same when we upgrade to Jenkins 2.
here are some links :
https://pghalliday.com/jenkins/groovy/sonar/chef/configuration/management/2014/09/21/some-useful-jenkins-groovy-scripts.html
https://github.com/DotCi/jenkinsci-dotci-example/blob/master/configure-dotci.groovy
https://gist.github.com/vrivellino/97954495938e38421ba4504049fd44ea
BTW , you can install your plugins using CLI it will save you time in the future.
if you have specific question , let me know
Thanks , Mor

Jenkins Scriptler Plugin Not Found in Available Plugins

Weirdly I cannot find jenkins scriptler plugin.It not already installed I checked.I tried "check now " option in plugin manager to update available plugins also .It updated but still cannot find scriptler plugin in available plugins.Is the name changed .I searched several times.Couldn't find if the name is changed.Please, help.
The Jenkins Scriptler plugin is no longer available, due to security reasons: https://wiki.jenkins-ci.org/display/JENKINS/Scriptler+Plugin
"Distribution of This Plugin Has Been Suspended"

Jenkins Email-ext plugin is no longer visible in the project's post build options

Does any one have any idea what could have happened to Jenkins Email-ext? We have had this plugin working just fine for over two years and all of sudden our entire configs for this plugin have disappeared from all of our projects. We tried to uninstall and re-install the plugin but that didn't make any difference.
Once you install this plugin there should be a checkbox under "Post-build Actions" section in the projects config page to enable it but this option is not shown any longer here. Any idea?
Thanks!
This issue was fixed by following the below steps:
Uninstall email-ext plugin from Jenkins
Stop Jenkins services. (Run > Services.msc) find Jenkins and stop it
Go to Jenkins home (base folder) > Plugins and remove any instances of email-ext plugin (e.g. C:\Program Files (x86)\Jenkins\plugins)
Restart Jenkins
Install email-ext plugin again
And now everything should be working OK again!
if you haven't upgraded your jenkins then the issue might be a different one , just to make sure email configuration section has completely removed from your job , check the config.xml of your jenkins job for the keyword [email-ext].
how to check job's config.xml from GUI ?
simple click on configure link of your job you will be redirected to something like below
http://yourserver/job/jobname/configure
now change the last part of url [configure to config.xml] resulting in something like below
http://yourserver/job/jobname/config.xml
now search for keywords like email and email-ext , if you did not find anything then email-ext plugin is not functioning or its has completely removed the email configuration from your job , if you find an entry , do a uninstall /install and then try a restart of jenkins might resolve your problem , or else you can try the option of reloading configuration from disk.

Grails fails if started with String parameter

I'm pretty new to the Grails Framework and I'm experiencing some strange behavior. If I use the grails commandline tool this way
grails "-DghprbPullTitle=Title with spaces" clean
grails fails with this error message
| Script 'With' not found, did you mean:
1) IntegrateWith
2) Init
3) CreateUnitTest
Starting grails this way will work
grails "-DghprbPullTitle=Title_without_spaces" clean
Ok one can now say "Then just avoid spaces" The problem is, that this occurs while I'm using Jenkins + Grails Plugin + Pull Request Builder Plugin. The Pull Request Builder Plugin generates some of these parameter with whitespaces.
Any thoughts how I can use grails with such whitespace-containing parameter. Or how I can tell the Pull Request Builder Plugin no to generate such parameter.
Maven on the other hand is able to handle such parameter.
Thanks in advance,
Marco
I ended up using shell builder with grailsw call instead of the Grails plugin.
Ok so it was a bug in the grails commandline tool. It will be fixed in grails 2.4-RC1.
See Grails Issue Tracker
The problem is that Grails Plugin + Pull Request Builder Plugin makes it pass build parameters from PR Builder plugin to grails commands. Those arguments with spaces are not required for build to happen, it's some kind of default in Grails Plugin to pass those parameters along to grails commands.
If Grails Wrapper on Grails Plugin didn't work for you, using Shell commands instead of Grails Plugin worked for me: it avoids parameters with space and makes GitHub notifications to work. It's worse for grails installations maintenance, but at least it's an alternative.
I submitted a PR https://github.com/jenkinsci/grails-plugin/pull/12 to work around this by suppressing the -D build environment variables.
I am using the Github pull request builder plugin https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin to run test-app and was running into the same issues as others. I am not using any of the variables that the ghprb plugin passes in so I added an option to suppress -D build environment variables. When this option is checked none of the -D variables are passed to grails allowing the build with grails plugin to run the targets as expected.
If you want to test it out to see if it works for you, you can download it from here http://jmoses.co/data/grails.hpi and install it manually How to install a plugin in Jenkins manually?

Resources