• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running PMD from commandline : Exporting the output to an external file.

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm using PMD from the commandline.
I've customized it to find some patterns in the code.How can i export the output i get to an external file like xml or any other.
The PMD site was not much of help in this regard.Please suggest me how to do it.

Thanks in advance,
Piyush
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The PMD command line help shows that you can pass the desired report format. If this isn't what you are looking for, please elaborate.
 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The output with the violations is listed on the command prompt.What i want is that if there is any method by which the violations can be exported to an external file .

Thannks,
Piyush
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can pipe it into a file using something like

your-command-to-run-PMD-goes-here > output.txt
 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I tried this but its not exporting the output to the file.
C:\PMD\java14\bin>pmd f:\my\source\somecode.java xml mycustomrules.xml -xslt my.xsl

Am i missing something?Please suggest me.

Thanks,
Piyush
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you try what I suggested?
 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks the method suggested is working.

Regards,
Piyush
reply
    Bookmark Topic Watch Topic
  • New Topic