Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

varScoper
Project Home Blog Forums Wiki Known Issues Screenshots Contact Project

varScoper Issue: create jenkins - warning plugin parser

Name: create jenkins - warning plugin parser
ID: 56
Project: varScoper
Type: Enhancement
Area: Administration
Severity: Low
Status: Open
Related URL: https://wiki.jenkins-ci.org/display/JENKINS/Warnings+Plugin
Creator: Mike Henke
Created: 01/24/12 11:45 AM
Updated: 01/24/12 11:45 AM
Description: Defining a new parser using the user interface

Since release 3.8 you can define new parsers dynamically in the system configuration section of Jenkins. Just navigate to http://[jenkins-url]/configure and create a new parser in section Compiler Warnings. The UI should be self explanatory, if there is something missing, please let me know on the mailing lists.
Writing a new parser that should be included in the warnings plug-in

Extending the existing set of supported warning formats is quite easy. If the format of the warnings messages could be parsed by an regular expression, then you only need to provide a new parser class and a corresponding test case:

Set up your developing environment as described in the Plugin tutorial
Clone the warnings plug-in from GitHub
Run maven with the command mvn install to see if the plug-in builds before you change anything
Add a new class YourFormatParser to the package hudson.plugins.warnings, see GccParser or JavacParser as examples
Add a new test case YourFormatParserTest to the package hudson.plugins.warnings, see GccParserTest or JavacParserTest as examples.
Register the new parser in the method getAllParsers() of the registry ParserRegistry
Send a pull request to get your changes integrated

Writing a new standalone parser that will be deployed in a new plug-in

If your parser is only of interest for your team or company then you can also develop a parser that will be bundled into a separate and private plug-in. The development approach is quite similar:

Set up your developing environment as described in the Plugin tutorial
Create a new plug-in that depends on the latest release of the warnings plug-in
Add a new parser class that implements WarningsParser. If your parser is based on regular expressions, then consider extending from either RegexpDocumentParser (multi-line parser) or RegexpLineParser (single-line parser).
Annotate your class with @Extension
Package your plug-in and deploy it to your Jenkins instance
History: Created by henkemike (Mike Henke) : 01/24/12 11:45 AM

To add a comment to this bug, please login using the link above.