Thursday, February 11, 2016

Install Jenkins plugins from command line including dependencies

To install Jenkins plugins from command line, including dependencies, run the following

curl -X POST -d '<jenkins><install plugin="plugin-name@latest" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins

where,
        - replace plugin-name with plugin to be installed
        - http://localhost:8080 is the URL where Jenkins service is available. Replace it with your Jenkins url path
       - @latest refers to the latest version of the plugin

Alternatively, one can try the following script too

   https://gist.github.com/micw/e80d739c6099078ce0f3

How to find the Jenkins plugins installed?

Suppose Jenkins  is available under the http url, http://localhost:8080, we can determine the plugins installed for Jenkins as follows

 java -jar jenkins-cli.jar -s http://localhost:8080 list-plugins

How to download Oracle JDK rpm and install?

To install Oracle JDK, download the rpm as follows

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.rpm"

How to find the Java(JVM) version used by Tomcat?

To find the Java(JVM) version used by Tomcat, when we observe multiple jdks installed in the system

Go to Tomcat service home directory and run the following command

java -cp lib/catalina.jar org.apache.catalina.util.ServerInfo