For me that looks like an issue of your shell command and not of the 
plugin. Can you try to store the actual file to your workspace and make the 
plugin parse that?
For me the warnings.ng.plugin is just working in conjunction with cppcheck.

What I am doing looks like this:

The cppcheck-call:

cppcheck --xml --output-file="cppcheck-result.xml"  --library=D:\cppcheck.cfg 
--platform=win32A --template="{file},{line},{severity},{id},{message}" .


and the plugin-part:
      stage('Static Analysis') {
                    steps {
                        // call cppcheck as part of a Makefile target
                        recordIssues sourceCodeEncoding: 'ISO-8859-1', tools
: [cppCheck(pattern:'**/cppcheck-result.xml')]
                    }
                }



Am Donnerstag, 2. April 2020 20:45:02 UTC+2 schrieb Ahmed Rafiq:
>
> Thanks for your reply.
> I've used the example xml from the given link, and getting error -
>
> Started by user unknown or anonymous
> Running as SYSTEM
> Building in workspace 
> /media/persistent_storage/home/jenkins-warnings/work/workspace/test
> [test] $ /bin/sh -xe /tmp/jenkins918250917560153069.sh
> + echo '<?xml version="1.0" encoding="UTF-8"?>
> <results version="2">
>   <cppcheck version="1.52"/>
>   <errors>
> /tmp/jenkins918250917560153069.sh: line 7: syntax error near unexpected token 
> `newline'
>   <error id="variableScope" severity="style" msg="The scope of the variable i 
> can be reduced" verbose="The scope of the variable i can be reduced. Warning: 
> It can be unsafe to fix this message. Be careful. Especially when there are 
> inner loops. Here is an example where cppcheck will write that the scope for 
> i can be reduced:&#xa;void f(int x)&#xa;{&#xa;    int i = 0;&#xa;    if (x) 
> {&#xa;        // its' safe to move 'int i = 0' here
> <?xml version="1.0" encoding="UTF-8"?>
> <results version="2">
>   <cppcheck version="1.52"/>
>   <errors>
>   <error id="variableScope" severity="style" msg="The scope of the variable i 
> can be reduced" verbose="The scope of the variable i can be reduced. Warning: 
> It can be unsafe to fix this message. Be careful. Especially when there are 
> inner loops. Here is an example where cppcheck will write that the scope for 
> i can be reduced:&#xa;void f(int x)&#xa;{&#xa;    int i = 0;&#xa;    if (x) 
> {&#xa;        // its safe to move int i = 0 here
> Build step 'Execute shell' marked build as failure
> [CPPCheck] Skipping execution of recorder since overall result is 'FAILURE'
> Finished: FAILURE
>
>
>
> On Thu, Apr 2, 2020 at 8:19 PM Ullrich Hafner <ullric...@gmail.com 
> <javascript:>> wrote:
>
>>
>>
>> Am 02.04.2020 um 13:06 schrieb Hakan Rafik <rafi...@gmail.com 
>> <javascript:>>:
>>
>> I'm using the next generation plugins to represent the CppCheck warnings 
>> and errors. 
>> But the plugins is not parsing* Carriage return*: &#xD; or *Line feed*: 
>> &#xA;. 
>>
>> I've tried to feed the plugins with the given example (
>> https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/cppcheck.xml)
>>  
>> generates error and didn't produces any formatted string.
>>
>> Any help in this regards is highly appreciated. 
>>
>>
>> When you don’t show error messages or log messages we cannot help. Just 
>> writing that it does not work is not enough information.
>>
>> Regards,
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkins...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkins...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a976054d-bd91-4643-96fe-927270bf5019%40googlegroups.com.

Reply via email to