Is it possible to use PhpStorm inspection results for continuous integration services?

Hello all,

it would be nice to use PhpStorm inspection results inside of a continuous integration system. Is there any possiblity to integrate it automagically via command line and export results in XML (e. g. for Hudson/Jenkins)?

Greetz and thanks
Thomas

1
14 comments

Currently you can export them manually:
inspections-export.jpg
Not sure about command line.

0
Avatar
Permanently deleted user

Thanks :D Great!

0
Avatar
Permanently deleted user

In current release 2.0 (linux) there is no inspect.sh or inspect.bat. Is this correct or should I create an issue in the tracker?

BTW: Thanks for release!

0

Well its contents for idea is is just

#!/bin/sh
./idea.sh inspect $*

0
Avatar
Permanently deleted user

Hm, i'm trying to get messages out of my PhpStorm (Release 2.0), but it fails with an error. Anything wrong with my Java installation or is this a bug?

Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:169)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ExceptionInInitializerError
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getGTKStyleFactory(GTKLookAndFeel.java:1543)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(GTKLookAndFeel.java:1507)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initialize(GTKLookAndFeel.java:1394)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:513)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:558)
        at com.intellij.ide.a.d.x.a(x.java:73)
        at com.intellij.idea.MainImpl._main(MainImpl.java:134)
        at com.intellij.idea.MainImpl.start(MainImpl.java:69)
        ... 6 more
Caused by: java.awt.HeadlessException
        at sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:64)
        at com.sun.java.swing.plaf.gtk.PangoFonts.<clinit>(PangoFonts.java:43)
        ... 14 more
[    108]  ERROR - llij.ide.plugins.PluginManager - Error while accessing com.intellij.idea.MainImpl.start with arguments: [inspect]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:169)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ExceptionInInitializerError
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getGTKStyleFactory(GTKLookAndFeel.java:1543)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(GTKLookAndFeel.java:1507)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initialize(GTKLookAndFeel.java:1394)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:513)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:558)
        at com.intellij.ide.a.d.x.a(x.java:73)
        at com.intellij.idea.MainImpl._main(MainImpl.java:134)
        at com.intellij.idea.MainImpl.start(MainImpl.java:69)

Caused by: java.awt.HeadlessException
        at sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:64)
        at com.sun.java.swing.plaf.gtk.PangoFonts.<clinit>(PangoFonts.java:43)
        ... 14 more
[    108]  ERROR - llij.ide.plugins.PluginManager - Error while accessing com.intellij.idea.MainImpl.start with arguments: [inspect]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:169)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ExceptionInInitializerError
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getGTKStyleFactory(GTKLookAndFeel.java:1543)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(GTKLookAndFeel.java:1507)
        at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initialize(GTKLookAndFeel.java:1394)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:513)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:558)
        at com.intellij.ide.a.d.x.a(x.java:73)
        at com.intellij.idea.MainImpl._main(MainImpl.java:134)
        at com.intellij.idea.MainImpl.start(MainImpl.java:69)
        ... 6 more
Caused by: java.awt.HeadlessException
        at sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:64)
        at com.sun.java.swing.plaf.gtk.PangoFonts.<clinit>(PangoFonts.java:43)
        ... 14 more
[    111]  ERROR - llij.ide.plugins.PluginManager - JDK: 1.6.0_24
[    111]  ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM
[    111]  ERROR - llij.ide.plugins.PluginManager - Vendor: Sun Microsystems Inc.
[    111]  ERROR - llij.ide.plugins.PluginManager - OS: Linux
[    111]  ERROR - llij.ide.plugins.PluginManager - Original exception:  

(and a lot of never ending messages...)

Tried different parameters behind "inspect" (project source directory, file name, ...) but everytime i get these error messages.
0

Please attach here complete command line.
Seems that java.awt.headless was not set while you run headless application. IDEA sets this property on inspections start - so the problem is somewhere in the command line
Thank you

0
Avatar
Permanently deleted user

My command line is now (added -v2):

./inspect.sh /home/tw/webs/abc/.idea/abc.iml /home/tw/.WebIde10/config/inspection/Default.xml /home/tw/out.xml -v2


Where /home/tw/webs/abc is the main folder of my PhpStorm project. I also tried the following:


But even getting nearly the same results:

Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
[YourKit Java Profiler 8.0.29] JVMTI version 3001016d; 19.1-b02; Sun Microsystems Inc.; mixed mode, sharing; Linux; 64-bit JVM
[YourKit Java Profiler 8.0.29] Profiler agent is listening on port 10001...
[YourKit Java Profiler 8.0.29] *** HINT ***: To get profiling results, connect to the application from the profiler UI
...
[    241]  ERROR - llij.ide.plugins.PluginManager - Error while accessing com.intellij.idea.MainImpl.start with arguments: [inspect, /home/tw/webs/abc/.idea/abc.iml, /home/tw/.WebIde10/config/inspection/Default.xml, /home/tw/out.xml, -v2, -d, /home/tw/webs/abc/smalltest/]

...


(...neverending messages)

Also I miss documentation of "Running Inspections Offline" in PhpStorms online documentation.
BTW: Do I need a separate license for dedicated CI server execution?

0

Thomas, please try the following

./inspect.sh /home/tw/webs/abc/.idea /home/tw/.WebIde10/config/inspection/Default.xml /home/tw/out -v2


.iml file contains information about IDEA's module but there should be a path to the project (.idea should be enough)
output - should be a directory.

Thank you
0
Avatar
Permanently deleted user

Created a new, clean directory under /home/tw/out and tried your option string, but still same result :-/

...
[    243]  ERROR - llij.ide.plugins.PluginManager - Error while accessing com.intellij.idea.MainImpl.start with arguments: [inspect, /home/tw/webs/abc/.idea/, /home/tw/.WebIde10/config/inspection/Default.xml, /home/tw/out, -v2]
...

0

/home/tw/webs/abc/.idea/

Please try path to your project /home/tw/webs/abc/.idea
Do not add tailing slash please. Do you see the same exceptions? Thank you
0
Avatar
Permanently deleted user

Yes, same exceptions with or without trailing slash.

0
Avatar
Permanently deleted user

Any chance to get this working for me?

0

sorry but you reallys need to file an issue to tracker - or your problem will be lost.

0

Please sign in to leave a comment.