Finding unused plugins in HUdson - hudson

I am using Hudson 3.3.1 in my org and I see a bunch of unwanted plugins being added to the hudson. I am planning to get rid of those unwanted or unused plugin. I thought of scanning all the job config files, but I have following questions.
If there are plugins that not being used by hudson job configs, but used by hudson configuration, What\which files should I search for?
In configs what should I be searching for. Pages what ever I am searching for is redirecting to jenkins pages.
I read through the following post How to list all unused jenkins plugins?
I tried installing this plugin http://updates.jenkins-ci.org/download/plugins/plugin-usage-plugin/ , but it started throwing out error as I believe it is supported only by jenkins

I added an answer to the question you linked that adds steps on how to search the main Jenkins configuration file as well as individual job config files. If you use the code in the linked question you should be able to find all the used plugins.

Related

DIY Tomcat, where is the webapp folder on the local git repo

following OpenShift tutorials, creating a tomcat application and clone it, the local repository will contain a pom.xml, webapp folder.
What's the equivalent on a diy application that contain a diy and misc folders
Thank's in advance, any help is appreciated cause I'm really stuck here !?
Update
Well I've install a Tomcat 8 DIY application following this tutorial here everything works fine, I can see the Tomcat page in the browser, the problem is how to deploy a .war file.
For a Tomcat 6/7 application on OpenShift, the local git repository have this structure:
____Tomcat7/6
|_________ webapp
|_________ src
|_________ pom.xml
But for a Tomcat 8 DYI application I have this structure
________Tomcat8/diy
|__________ Diy
|__________ misc
|__________ readme
So Where to deploy my .war files, cause there is no webapp folder?
The title of your question suggests that you are mixing up at least 5 different, completely independent & orthogonal tools and concepts:
Git is a version control system ("push", "local repo")
Maven is a build tool ("pom.xml")
Apache Tomcat is a servlet container ("Tomcat 6/7/8")
rhc is some client tool provided by yet another cloud computing platform ("OpenShift")
Your code is the stuff that you have written, it's completely under your responsibility.
Before you start doing anything, please make sure that you have at least some basic understanding of what each of these tools does. Then ask yourself whether you really need Tomcat 8 instead of Tomcat 7, and whether a 2 year blog post about the compilation of Tomcat 8 within an OpenShift gear is the best source. All these deployment details can change pretty quickly, if it worked two years ago, it's not guaranteed that it would work now.
I've never worked with OpenShift, but as far as I understand, the basic idea is this:
You write your code
You create your OpenShift account and allocate some "Gear" (or "Dyno" or whatever...) for your application
You commit your source code (/src) and the files that are necessary for the build (pom.xml), and use git to push it to the repository OpenShift gave you.
OpenShift then uses your pom.xml and builds all the WAR-files on it's own
Then you can use your rhc client tool to start your application, if that's not done automatically.
Some of these steps can be changed.
If you really have to, you can indeed compile your own Tomcat8, the tutorial you linked tells you how (more or less. The dude who did it obviously knew what he was doing there, so he might have skipped some details that seemed trivial to him).
Furthermore, if you really want, you can deploy pre-packaged WAR-files, by deliberately removing all the stuff that is necessary to build you app (removing pom.xml and all the /src), and instead adding the packaged application to your git repo, and then pushing it all to OpenShift. Then it will skip the build step, and just run what you gave it. OpenShift seems to provide some information about this deployment strategy: https://help.openshift.com/hc/en-us/articles/202399740. Please read the documentation and make sure you understand what you want to do. For example, filter-branching your git repo and removing all source files you have ever written is not a good idea, even if you don't need these files on OpenShift.
Currently, I don't see anything of the standard tomcat directory structure in the tree that you show. Instead, there seem to be just some basic ruby-scripts or some other default-demo-app-stuff... That's why it's called "do it yourself". If you don't want this, take a standard Tomcat7 app.

How to Set Maven Parameters in OpenShift

I'm completely new to OpenShift and so far ran in hundreds of bugs while trying to create my first application. Now I want to configure Maven to use my own goals. So far I tried:
adding a Jenkins and configuring the Maven Build - the Jenkins didn't take up the changes and finally stopped building altogether
adding a file .openshift/action_hook/pre_build with the content export MAVEN_ARGS="clean package -Popenshift" as explained here
adding a file .openshift/action_hook/build with the content mvn clean package -Popenshift as explained there
Evidently, the documentation is somewhat obsolete... so what is the correct way?
I finally managed to get the Jenkins to build with my goals. The misconception was that it would use the configured Maven goals INSTEAD of the default ones, when it would just use them additionally (he never had to, since the shell script failed). So deleting the script and adding a custom Maven build works.

How to use Mercurial in side Eclipse Helios (3.6)

I am using Eclipse Helios (3.6). I want to use Mercurial for version management of the program. I have take the help of the below link to find out the plugin but not got any success:
Mercurial Eclipse Plugin
Can any one please help to install Mercurial plugins inside my Eclipse and I also don't know how to use also. I have gone through the video also but not clear.
http://www.youtube.com/watch?v=9OBg6Zv0Tns
My question is that I want to use Mercurial in my project for version control. I know what Mercurial is, but don't know how to use it.
I want to know what is the initial setup that I have do if I want to use Mercurial set up in my project.
When I am trying to add new software It is giving me following error.
the 'Duplicate Location' error message in your screenshot would indicate that there is already an update site setup for that URL.
In the screen before doing the 'add repository' look at the list of current update sites and you may find one for Mercurial already. Make sure it is selected and a list of all the features for that update site will be listed for you. Then you can select the MercurialEclipse and MercurialBinaries features and install then in Eclipse
The Mercurial Eclipse homepage is here: http://javaforge.com/project/HGE.
They have installation instructions there:
[...] you can get the plugin easily using the Eclipse Update Manager, just click Help → Software Updates in Eclipse. The Eclipse Update Site for MercurialEclipse is available at this URL:
http://cbes.javaforge.com/update
If you are not familiar with getting new software and updates to Eclipse, please read this article.

How do I uninstall a plugin from Jenkins (Hudson)?

I have a few plugins in my Jenkins installation which I no longer need. I've already disabled the plugins (and my build still work), and I'd like to remove the plugins completely. What is the right process for completely removing a Jenkins (Hudson) plugin?
As mentioned by Jesse Glick in his answer, if you are using Jenkins 1.487 or higher, then there is a native way to uninstall plugins in the Jenkins UI. See JENKINS-3070 for details.
If you are using a version of Jenkins earlier than 1.487, then you can try manually uninstalling the plugin. As some people point out in the comments, this may not work on some platforms (in those cases, upgrade to at least 1.487 so that you can use the official uninstall feature).
To manually uninstall a plugin, stop Hudson/Jenkins, go to your HUDSON_HOME/plugins directory and remove both the .hpi file and the folder with the same name. So, if you were going to remove the CVS plugin, you would remove both the cvs.hpi file and the cvs directory.
After that, restart Hudson/Jenkins and the plugin won't be there anymore.
Jenkins 1.487 adds a UI for uninstalling plugins: JENKINS-3070
Deleting the <plugin>.hpi file and corresponding <plugin>-plugin directory will effectively remove the plugin.
However, if you have configured parameters that belong to the plugin within your jobs your Hudson or tomcat logs may contain *CannotResolveClassException: hudson.plugins ... * exceptions because it attempts to load the plugin. This can result in build failures even if build is successful.
To fix that,
go to the job configuration and save it again. This should get rid of the plugin reference
if not, go into the hudson home jobs directory and open the config.xml found under the folder named after the job and remove the reference to the plugin
restart hudson
Hudson Plugins explains that some core plugins ("Tier 1" plugins, as they are called) are shipped with Hudson itself, and I assume cannot be deleted therefore.
You can disable it using the Jenkins » Plugin Manager. Go to Installed tab and untick the plugins you want to uninstall and restart Jenkins. Though it does not unintall, at least keeps it away from appearing from configuration pages..

Execute command in Hudson as Post-build Actions

I am new in Hudson.
I would like to execute a 'sourcecodeanalyzer' command in Hudson as Post-build Actions to generate an html report. Please let me know is this at all possible, if yes let me know the Hudson configuration steps to execute the command.
Your earliest response in this regard will be extremely helpful.
Thanks in advance.
Yes, it is almost certainly possible.
You will need to configure the Hudson project to have either a post-build action or a build step that runs your source code analyzer.
You've not stated in your question precisely which analyzer - it may be that Hudson already has a plug-in installed for it, in which case it may be listed on the Config page for the project at the bottom under Post-build Actions.
If not, next check to see if there's a plug-in available for the analyzer that hasn't been installed. From the main Hudson page select Manage Hudson, then Manage Plugins, and choose the Available tab. If there is a plug-in available it's definitely a good idea to use it as they are generally very well integrated with Hudson itself.
As a last resort you'll have to configure a build step to run the analyzer. Configure the project, then choose "Add build step". The drop-down that appears depends on your environment (Windows or Linux) but should include the ability to run a shell command or batch file. You can configure your analyzer there.
(If you're building Windows Visual Studio applications, a more flexible way that I've used is to use the MSBuild plug-in for builds, and have an MSBuild script that builds the application and then runs analysis tools. This can automate pretty much everything: mine builds the application, builds an acceptance test database, runs the acceptance tests and copies the result HTML to a page linked from the project.)
You could create a new job with a "Execute Shell" build step. Type in the command you wish to run in the text box. Then all you have to do is trigger this job by selecting:
"Build after other projects are built"
And select the trigger job from the list.
Hope this helps!
As a follow up to Jeremy's post. If you don't see the ability to add post build steps, you might work with maven jobs. In that case you need the Hudson M2 Extra Steps Plugin. This will give you pre and post build steps.
I use the 'Post build task' plugin to delete some resources after a build. You could call any shell script or command lines. If you want you could make the call depends on some logging output.
there is one best way to solve this:
Upgrade to Fortify SCA 2.6.x (as of writing, latest version is 2.6.5).
Download the Fortify Maven Plugin version 2.6 from https://customerportal.fortify.com and install it into your Hudson server's Maven repository.
Update your project's pom to carry out the Fortify scan. There is an example provided with the Maven plugin.
Currently , I am experiment with sonar plug in. It looks great check the details here
http://sonar.codehaus.org/a-new-hudson-plugin-for-a-closer-integration-with-sonar/
http://wiki.hudson-ci.org/display/HUDSON/Sonar+plugin