Checkstyle Jenkins - How do I Configure Checkstyle in Jenkins? - plugins

I am new to using Jenkins and I recently built a project with it and installed the "Checkstyle" plugin and received a report.
I want to know how I can configure "Checkstyle" to, let's say, ignore whitespaces or other criteria that may come up?
Thank you!

Jenkins simply reads the checkstyle report after it was run in the course of a build, and is extraneous to the question. To configure checkstyle, you want to modify or create checkstyle.xml (the location is configurable via method based your choice of build automation tool, such as maven or gradle. The checkstyle manual has further details on how to accomplish any checks you may desire.

Related

Including Checkstyle suppressions in SonarQube Checkstyle Permalink to use in Eclipse

I want to use Sonar's Checkstyle configuration in our Eclipse environment for on-compile-time analysis of our rules.
Therefore I've already included the permalink of Sonar's quality profile in Eclipse Checkstyle plug-in. However the generated Checkstyle configuration XML file only contains an empty SuppressionCommentsFilter tag.
I want to include our project specific suppressions XML file in the configuration as well. I've set the link to the suppressions.xml in the project settings for the Checkstyle plug-in.
Is there a way to include the suppressions configuration in the permalink generated from sonar? Or is there a different approach that I should try to accomplish this?
Using SonarQube Eclipse plug-in on full maven builds only isn't an option as mentioned in this similar question (Using SonarQube to distribute checkstyle for multiple projects including Suppressions for eclipse) as I want fast feedback about most violations and errors when saving code changes the same way it is offered by Eclipse Checkstyle plug-in (and others like PMD and FindBugs).
My current impression is that there is a discrepancy between project configuration and reusable quality profiles. I should be able to reuse profiles for new projects in Sonar - which I can - but import project settings in other applications - which i can't right now.

How to build RCP application based on Product Configuration and Target Platform Definition?

I'm about the setup an automatic (command-line) build for my Eclipse RCP Application.
I have found out the following ways to do it:
Buckminster
Using Maven with the pde-maven-plugin
Headless PDE Build
The problem with all these options is that they require me to create essentially a new representation of the information already contained in my target platform definition. For example in Buckminster, this would be the .rmap file.
In my thinking all the information to build the product should be already there when I have the following:
Plugin project with product configuration file (foo.product)
Target platform definition file (foo.target)
Therefore I would expect there to be a command like the following:
build-rcp-product foo.product foo.target win32
Is there anything like that which I may have missed?
With Buckminster you don't need to replicate the information in your target definition file. You can simply import the target file using the importtargetdefinition command. If all your dependencies defined in the target definition file, then in the rmap you define only from where to materialize your plugins (svn, git, maven, file system etc).
With PDE build, there is a filed request (Bug 266311) and it seems it is still not possible to utilize the target file directly but there are some workarounds suggested in there (which I didn't try, I am using Buckminster).
I use the PDE build and it's pretty simple. It essentially gets what it needs from the MANIFEST.MF file and the build.properties file.
The command to run it is more complicated, as you have to start Eclipse and point it to a few things, but it's very well integrated with the IDE. It does everything by making Ant scripts.
you can try tycho
here's a good start:
Tycho tutorial
Reference card
with tycho, all you need is a POM and you usually will not change this information, which is generated via maven

m2eclipse: How do I configure parameters to the Maven Project Builder?

In Eclipse Helios with m2eclipse installed, Build Automatically is on by default. I can see that this uses some sort of incremental Maven builder under the covers (for Maven projects, obviously).
How can I customize the Maven builder so that, for example, I can supply it with some -D options? Specifically, I want my automatic, incremental Maven builds to be run with -Dmaven.buildNumber.doCheck=false. I see nowhere where I can actually affect the configuration of the m2eclipse-supplied Maven builder.
I am aware that I can create a run configuration and then explicitly build my project using Run As..., but I don't want to pursue that path. I want to customize the way my project is built when I choose the Build All command from the Project menu. I also want these customizations to be in effect when an automatic build is triggered.
I don't particularly want to add settings to my ~/.m2/settings.xml file because I don't actually want my command-line Maven installation to pick up these settings outside of Eclipse.
Thanks in advance for any help here.
At the moment, you need to put the settings in a profile and then trigger that profile. The M2E gang has removed the settings that used to be useful for this purpose.
You can make a custom settings.xml in a separate location and configure THAT in the m2e prefs.

How can I configure additional eclipse settings with m2eclipse?

With the maven eclipse plugin, I can configure checkstyle or sonar configurations by adding the necessary invocations to the pom.xml and calling "mvn eclipse:eclipse" to create the project configuration.
Some members of my team want to just use "Import Maven project" and therefore don't get the benefits of the project preconfigurations. Is there a way to provide the same (or similiar) hints to m2eclipse?
What I want to accomplish is that people simply "Import Maven Project", and they automatically get a project preconfigured with the correct checkstyle configuration (which is possibly downloaded from somewhere as defined in the POM) without having to manually go into the project preferences and click around a lot. That somehow defeats the purpose of automatic project generation :-)
There are more detailed answers to this topic in Can I Configure m2eclipse through pom.xml?: Completely automatic configuration can only be achieved with a ProjectConfigurator. But there is a solution based on AntRun and XMLTask even for FindBugs and Sonar. It needs manual triggering only once after checkout.
This is doable by writing custom ProjectConfigurator (as mentioned in this thread). And it looks like somebody plublished some of them (for Checkstyle, PMD, FindBugs) in the m2e-extensions project.

Building Eclipse plugins and features on the command line

I have a bunch of Eclipse plugins and features, which I would like to build as part of a nightly (headless) build. I've managed to do this using a complicated setup involving manually specifying paths to Eclipse plugin jars, copying customTargets.xml, etc.
Is there really no simpler solution? Isn't there a way to just point out my Update Site's site.xml and say "build"; i.e. the equivalent of clicking "Build All" in the Update Site project?
Given that all the answers to this question are all 3-5 years old, I figure an update would be useful to others.
For those who want to add the building of Eclipse plugins to the CI process, I recommend they check out the Eclipse Tycho project. This is essentially a Maven plugin that allows you you to wrap eclipse projects within Maven project. With this we use Atlassian Bamboo to build our Eclipse plugin. This also allows us to use the Maven jarsigner plugin to sign our plugin files.
I've just been fighting with this problem myself. Are you using the productBuild script? Maybe putting your features into a product would help you out.
I am doing a headless build on a product configuration. The only script that I customized was to add some ant tasks to customTargets.xml to get my sources from SVN and to do a little cleanup on JNLP manifests after the build as I am using WebStart.
Then you only need to invoke antRunner on the out of the box productBuild.xml in the scripts/productBuild directory (in the pde-build plugin).
Check out Ant4Eclipse. I've used it to parse Eclipse's .classpath/.project files to determine project dependencies and classpaths. In combination with Groovy Ant Task, I have automatically built multiple projects in Ant using the Eclipse project files for build information.
A buildPlugin task exists, but I have not personally used it.
We are currently using PDE to automatically build features and our complete product. It works quite well. Make sure you use the right script for product build or feature build.
Eclipse Help on using PDE
EDIT: We've now migrated to Buckminster, which has an excellent command line interface.
You might look into buckminster and maven. There is a learning curve for sure, but they seem to do their jobs well.
We are using headlesseclipse, which can be found on Google Code:
http://code.google.com/p/headlesseclipse/
It works quite well, and can easily automate command-line building of plugins and features. However, I have not yet found a way to automate building of the update site via the command line.