Static Code Analysis Tool


(Kai Kreuzer) #41

No, I looked at SonarQube about a year ago and it seems this profile was introduced only after that. (actually I just found a mail thread with Sonar guys where we asked for that and they promised to have that feature by Q4/2016).

Would definitely be nice to have! @michaelschaaf was looking at SonarQube last year and he also has access to SonarQube - @michaelschaaf, maybe you want to join this effort again?


(Michael Schaaf) #42

I have asked the guys from SonarSource when it will be possible to provide project specific rulesets on their nemo instance for open source projects. I will notify you when i get an answer.

Perhaps the better way is to provide an own instance of sonarqube anywhere.

https://nemo.sonarqube.com/


(Michael Schaaf) #43

Got feedback from SonarSource Team. They are currently working on project specific rulesets and hope that feature will be available before end of Q2.


(Gregory Moyer) #44

When I run

mvn clean install -P check

on an up-to-date fork of the openhab2-addons repo in my binding directory (using version 0.0.3 of the static analysis plugin), it appears the Checkstyle configuration from this tool is ignored. The checkstyle-result.xml file lands in target/ rather than target/code-analysis/ so target/code-analysis/report.html fails to generate.

Also, I see the following when I add '--debug' to the mvn command above:

[DEBUG] request.getConfigLocation() sun_checks.xml

which makes me believe the rules.xml file from the jar is being ignored as well.

Am I not running this properly or is there something wrong with the tool?


(Kai Kreuzer) #45

Err, sorry, I should have mentioned this:
I just did a change that made the check profile being active by default - so there should actually be no need anymore to add a "-P check". If you want to disable it, you can add the parameter "-DskipChecks=true".


(Martin van Wingerden) #46

Hello guys, is there a way to view the report of a PR?

A lot of branches only seem to fail at Travis and there is a reference to a report file but that is a local path, so can we view the reports of the branch in someway or should we build it local to see whether new warnings were introduced?


(Martin van Wingerden) #47

I also miss a page where I can refer people to, tell them how to generate the report and where they can find it. Did we already make such a page and if not where should it live so I can create it myself?


(Kai Kreuzer) #48

No, since I didn't yet manage to get Jenkins build the PRs with the static analysis tool enabled - see https://github.com/openhab/static-code-analysis/issues/15.
I only added Travis additionally for the moment to have the builds failing and notify the contributor that something seems to be violated. On Travis, we do not have access to the generated report, though. On Jenkins, we would be able to keep this for easy reference.

Did we already make such a page and if not where should it live so I can create it myself?

No, this tool isn't mentioned yet. I'd think the best place to add such an info would be http://docs.openhab.org/developers/development/bindings.html#include-the-binding-in-the-build-and-the-distro.


(Svilenvul) #49

I have created a PR in the openhab-docs repo - https://github.com/openhab/openhab-docs/pull/379


(Martin van Wingerden) #50

Thanks, I did still only have the intention and and empty fork :wink:


(Jürgen Baginski) #51

High,
I'm trying to check and update my code using this Tool. I do get lots of "NewlineAtEndOfFileCheck" reports. Although they are priority 3, I'm trying to resolve them, however it seems that I can't!
Removing all lines after the last line with code, adding a line or two lines, nothing helps. Or am I doing something wrong by hitting the "Enter" key in order to create a new line in the Eclipse IDE?

While I'm at it, the code reports amongst lots of other things: "[INFO] Fork Value is false" followed by an long list of files not found.
Am I doing something totally wrong?


(Svilenvul) #52

While I'm at it, the code reports amongst lots of other things: "[INFO] Fork Value is false" followed by an long list of files not found.

[INFO] Fork Value is false is expected, but the long list of missing files is not. Could you add this part of the log? If it is a public PR, a link to the PR might be helpful as well, so we can take a look at the files.

If you find some problems with the tool, please feel free to open issues in the Static Code Analysis repo.


(Jürgen Baginski) #53

Thanks for the feedback.

Since I'm still a beginner (especially when it comes to coding in java AND using git etc..) I'm initially searching for the failure in my usage, hence the question in here.
If it isn't me, I'll post an issue (as done before).

I'm working on a repository which is forked from an author of a new binding, who in turn forked from openhab2-addons (which could be more then 2 month ago). This migth change in a while, so that I'll work on direct fork of openhab2-addons.
My fork is here, and I'm working on the "Tankerkoenig" binding.

Here are the missing file lines:
The first bunch is pointing to "C:\Users\J?rgen.m2\repository....", my local repository however is at D:\MyTankerkoenig. Did I do something wrong in the setup of git?

The second bunch starts with the statement "The following classes needed for analysis were missing:" and is listing files that are either needed by my binding or they are especially written for it. That part I don't understand since the binding is working and I do get comments on those files from the analysis tool.

 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\mojo\findbugs-maven-plugin\3.0.1\findbugs-maven-plugin-3.0.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\google\code\findbugs\findbugs\3.0.1\findbugs-3.0.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\jcip\jcip-annotations\1.0\jcip-annotations-1.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\google\code\findbugs\jsr305\2.0.1\jsr305-2.0.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\google\code\findbugs\bcel-findbugs\6.0\bcel-findbugs-6.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\google\code\findbugs\jFormatString\2.0.1\jFormatString-2.0.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\ow2\asm\asm-debug-all\5.0.2\asm-debug-all-5.0.2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\ow2\asm\asm-commons\5.0.2\asm-commons-5.0.2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\ow2\asm\asm-tree\5.0.2\asm-tree-5.0.2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\apple\AppleJavaExtensions\1.4\AppleJavaExtensions-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\jaxen\jaxen\1.1.6\jaxen-1.1.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\openhab\tools\static-code-analysis\0.0.4\static-code-analysis-0.0.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\slf4j\slf4j-api\1.7.24\slf4j-api-1.7.24.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\slf4j\slf4j-simple\1.7.24\slf4j-simple-1.7.24.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\sourceforge\pmd\pmd-xml\5.5.1\pmd-xml-5.5.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\sourceforge\pmd\pmd-core\5.5.1\pmd-core-5.5.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\beust\jcommander\1.48\jcommander-1.48.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\google\code\gson\gson\2.5\gson-2.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\sourceforge\saxon\saxon\9.1.0.8\saxon-9.1.0.8.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\sourceforge\saxon\saxon\9.1.0.8\saxon-9.1.0.8-dom.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\sourceforge\pmd\pmd-java\5.5.1\pmd-java-5.5.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\java\dev\javacc\javacc\5.0\javacc-5.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\puppycrawl\tools\checkstyle\7.2\checkstyle-7.2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\antlr\antlr4-runtime\4.5.3\antlr4-runtime-4.5.3.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-cli\commons-cli\1.3.1\commons-cli-1.3.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\puppycrawl\tools\checkstyle\7.2\checkstyle-7.2-tests.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\plugins\maven-plugin-plugin\3.5\maven-plugin-plugin-3.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\plugin-tools\maven-plugin-tools-api\3.5\maven-plugin-tools-api-3.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\plugin-tools\maven-plugin-tools-generators\3.5\maven-plugin-tools-generators-3.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\net\sf\jtidy\jtidy\r938\jtidy-r938.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\plugin-tools\maven-plugin-tools-java\3.5\maven-plugin-tools-java-3.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\thoughtworks\qdox\qdox\2.0-M4\qdox-2.0-M4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\plugin-tools\maven-plugin-tools-annotations\3.5\maven-plugin-tools-annotations-3.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-archiver\2.1.1\plexus-archiver-2.1.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-io\2.0.3\plexus-io-2.0.3.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\plugin-tools\maven-plugin-annotations\3.5\maven-plugin-annotations-3.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-repository-metadata\2.2.1\maven-repository-metadata-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\surefire\maven-surefire-common\2.19.1\maven-surefire-common-2.19.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\surefire\surefire-api\2.19.1\surefire-api-2.19.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\surefire\surefire-booter\2.19.1\surefire-booter-2.19.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-toolchain\2.2.1\maven-toolchain-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\twdata\maven\mojo-executor\2.2.0\mojo-executor-2.2.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\ivy\ivy\2.4.0\ivy-2.4.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\jsoup\jsoup\1.7.1\jsoup-1.7.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\jp\skypencil\findbugs\slf4j\bug-pattern\1.2.4\bug-pattern-1.2.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\com\google\guava\guava\18.0\guava-18.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\gmavenplus\gmavenplus-plugin\1.3\gmavenplus-plugin-1.3.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-project\2.2.1\maven-project-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-settings\2.2.1\maven-settings-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-profile\2.2.1\maven-profile-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-interpolation\1.11\plexus-interpolation-1.11.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-core\2.2.1\maven-core-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-plugin-parameter-documenter\2.2.1\maven-plugin-parameter-documenter-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\slf4j\slf4j-jdk14\1.5.6\slf4j-jdk14-1.5.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\slf4j\jcl-over-slf4j\1.5.6\jcl-over-slf4j-1.5.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-error-diagnostics\2.2.1\maven-error-diagnostics-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-interactivity-api\1.0-alpha-4\plexus-interactivity-api-1.0-alpha-4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-monitor\2.2.1\maven-monitor-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\sonatype\plexus\plexus-sec-dispatcher\1.3\plexus-sec-dispatcher-1.3.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\sonatype\plexus\plexus-cipher\1.4\plexus-cipher-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\shared\file-management\1.2.1\file-management-1.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\shared\maven-shared-io\1.1\maven-shared-io-1.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\wagon\wagon-provider-api\1.0-alpha-6\wagon-provider-api-1.0-alpha-6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-classworlds\2.5.2\plexus-classworlds-2.5.2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-plugin-registry\2.2.1\maven-plugin-registry-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\fusesource\jansi\jansi\1.11\jansi-1.11.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\jline\jline\2.12\jline-2.12.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\ant\ant\1.9.4\ant-1.9.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\ant\ant-launcher\1.9.4\ant-launcher-1.9.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\groovy\groovy-all\2.4.0\groovy-all-2.4.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\reporting\maven-reporting-impl\2.1\maven-reporting-impl-2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-validator\commons-validator\1.2.0\commons-validator-1.2.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-digester\commons-digester\1.6\commons-digester-1.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\oro\oro\2.0.8\oro-2.0.8.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\reporting\maven-reporting-api\3.0\maven-reporting-api-3.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-plugin-api\2.0\maven-plugin-api-2.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-plugin-descriptor\2.2.1\maven-plugin-descriptor-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-artifact\2.2.1\maven-artifact-2.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\doxia\doxia-core\1.4\doxia-core-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\doxia\doxia-logging-api\1.4\doxia-logging-api-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-component-annotations\1.5.5\plexus-component-annotations-1.5.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\xerces\xercesImpl\2.9.1\xercesImpl-2.9.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\httpcomponents\httpclient\4.0.2\httpclient-4.0.2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\httpcomponents\httpcore\4.0.1\httpcore-4.0.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\doxia\doxia-sink-api\1.4\doxia-sink-api-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\doxia\doxia-decoration-model\1.4\doxia-decoration-model-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\doxia\doxia-site-renderer\1.4\doxia-site-renderer-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\doxia\doxia-module-xhtml\1.4\doxia-module-xhtml-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\doxia\doxia-module-fml\1.4\doxia-module-fml-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-i18n\1.0-beta-7\plexus-i18n-1.0-beta-7.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-velocity\1.1.7\plexus-velocity-1.1.7.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\velocity\velocity\1.5\velocity-1.5.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\velocity\velocity-tools\2.0\velocity-tools-2.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-chain\commons-chain\1.1\commons-chain-1.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\sslext\sslext\1.2-0\sslext-1.2-0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\struts\struts-core\1.3.8\struts-core-1.3.8.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\struts\struts-taglib\1.3.8\struts-taglib-1.3.8.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\struts\struts-tiles\1.3.8\struts-tiles-1.3.8.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\shared\maven-doxia-tools\1.2.1\maven-doxia-tools-1.2.1.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-artifact-manager\2.0.6\maven-artifact-manager-2.0.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\maven\maven-model\2.0.6\maven-model-2.0.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-container-default\1.0-alpha-9\plexus-container-default-1.0-alpha-9.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\classworlds\classworlds\1.1-alpha-2\classworlds-1.1-alpha-2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-resources\1.0-alpha-7\plexus-resources-1.0-alpha-7.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\codehaus\plexus\plexus-utils\1.5.6\plexus-utils-1.5.6.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\sonatype\plexus\plexus-build-api\0.0.7\plexus-build-api-0.0.7.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\org\apache\felix\org.apache.felix.fileinstall\3.4.0\org.apache.felix.fileinstall-3.4.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\javax.inject\1.0.0.v20091030\javax.inject-1.0.0.v20091030.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.osgi\3.10.2.v20150203-1939\org.eclipse.osgi-3.10.2.v20150203-1939.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\com.google.inject\3.0.0.v201312141243\com.google.inject-3.0.0.v201312141243.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.osgi.services\3.4.0.v20140312-2051\org.eclipse.osgi.services-3.4.0.v20140312-2051.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.core.contenttype\3.4.200.v20140207-1251\org.eclipse.core.contenttype-3.4.200.v20140207-1251.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.equinox.preferences\3.5.200.v20140224-1527\org.eclipse.equinox.preferences-3.5.200.v20140224-1527.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.equinox.registry\3.5.400.v20140428-1507\org.eclipse.equinox.registry-3.5.400.v20140428-1507.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.equinox.common\3.6.200.v20130402-1505\org.eclipse.equinox.common-3.6.200.v20130402-1505.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.core.jobs\3.6.1.v20141014-1248\org.eclipse.core.jobs-3.6.1.v20141014-1248.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.core.runtime\3.10.0.v20140318-2214\org.eclipse.core.runtime-3.10.0.v20140318-2214.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.equinox.app\1.3.200.v20130910-1609\org.eclipse.equinox.app-1.3.200.v20130910-1609.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.emf.common\2.11.0.v20150512-0501\org.eclipse.emf.common-2.11.0.v20150512-0501.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.emf.ecore\2.11.0.v20150512-0501\org.eclipse.emf.ecore-2.11.0.v20150512-0501.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.emf.ecore.xmi\2.11.0.v20150512-0501\org.eclipse.emf.ecore.xmi-2.11.0.v20150512-0501.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.config.core\0.9.0.201705120951\org.eclipse.smarthome.config.core-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\com.google.guava\10.0.1.v201203051515\com.google.guava-10.0.1.v201203051515.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\com.google.gson\2.5.0\com.google.gson-2.5.0.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.apache.commons.lang\2.6.0.v201404270220\org.apache.commons.lang-2.6.0.v201404270220.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.core\0.9.0.201705120951\org.eclipse.smarthome.core-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.slf4j.api\1.7.2.v20121108-1250\org.slf4j.api-1.7.2.v20121108-1250.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.apache.commons.io\2.2.0.v201405211200\org.apache.commons.io-2.2.0.v201405211200.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.core.autoupdate\0.9.0.201705120951\org.eclipse.smarthome.core.autoupdate-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.core.persistence\0.9.0.201705120951\org.eclipse.smarthome.core.persistence-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.core.thing\0.9.0.201705120951\org.eclipse.smarthome.core.thing-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.apache.commons.collections\3.2.0.v2013030210310\org.apache.commons.collections-3.2.0.v2013030210310.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.io.console\0.9.0.201705120951\org.eclipse.smarthome.io.console-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.model.core\0.9.0.201705120951\org.eclipse.smarthome.model.core-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.xtext.common.types\2.9.2.v201603040440\org.eclipse.xtext.common.types-2.9.2.v201603040440.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.xtext\2.9.2.v201603040440\org.eclipse.xtext-2.9.2.v201603040440.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.model.item\0.9.0.201705120951\org.eclipse.smarthome.model.item-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.xtext.util\2.9.2.v201603040440\org.eclipse.xtext.util-2.9.2.v201603040440.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.antlr.runtime\3.2.0.v201101311130\org.antlr.runtime-3.2.0.v201101311130.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.xtext.xbase.lib\2.9.2.v201603040440\org.eclipse.xtext.xbase.lib-2.9.2.v201603040440.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.slf4j.log4j\1.7.2.v20130115-1340\org.slf4j.log4j-1.7.2.v20130115-1340.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\.cache\tycho\org.eclipse.smarthome.model.persistence-0.9.0.201705120951.jar\lib\joda-time-2.9.2.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.smarthome.model.persistence\0.9.0.201705120951\org.eclipse.smarthome.model.persistence-0.9.0.201705120951.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.apache.commons.logging\1.1.1.v201101211721\org.apache.commons.logging-1.1.1.v201101211721.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.xtend.lib\2.9.2.v201603040440\org.eclipse.xtend.lib-2.9.2.v201603040440.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.xtend.lib.macro\2.9.2.v201603040440\org.eclipse.xtend.lib.macro-2.9.2.v201603040440.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.eclipse.xtext.smap\2.9.2.v201603040440\org.eclipse.xtext.smap-2.9.2.v201603040440.jar
 [java]   File not found: filesystem:C:\Users\J?rgen\.m2\repository\p2\osgi\bundle\org.objectweb.asm\5.0.1.v201404251740\org.objectweb.asm-5.0.1.v201404251740.jar
 [java] The following classes needed for analysis were missing:
 [java]   org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler
 [java]   org.eclipse.smarthome.core.thing.binding.BaseThingHandler
 [java]   org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory
 [java]   com.google.gson.JsonDeserializer
 [java]   org.slf4j.LoggerFactory
 [java]   org.apache.commons.io.IOUtils
 [java]   org.slf4j.Logger
 [java]   com.google.gson.GsonBuilder
 [java]   com.google.gson.Gson
 [java]   com.google.gson.JsonElement
 [java]   com.google.gson.JsonObject
 [java]   com.google.gson.JsonDeserializationContext
 [java]   org.eclipse.smarthome.core.thing.ThingTypeUID
 [java]   com.google.common.collect.Sets
 [java]   org.eclipse.smarthome.core.thing.Thing
 [java]   org.eclipse.smarthome.core.thing.ThingStatus
 [java]   org.eclipse.smarthome.core.thing.ThingStatusDetail
 [java]   org.eclipse.smarthome.config.core.Configuration
 [java]   org.eclipse.smarthome.core.thing.Bridge
 [java]   org.eclipse.smarthome.core.library.types.DecimalType
 [java]   org.eclipse.smarthome.core.thing.ThingUID
 [java]   org.joda.time.LocalDate
 [java]   org.joda.time.DateTime
 [java]   org.joda.time.LocalTime
 [java]   com.google.gson.JsonParseException
 [java]   org.eclipse.smarthome.core.thing.binding.BridgeHandler
 [java]   com.google.common.collect.Sets$SetView

(Jürgen Baginski) #54

The tool was working for me although the above posted missing files.

When trying to use it today I get the following fatal error, which I can't understand.

[java] Missing classes: 24
[java] Analysis errors: 182
[INFO] Done FindBugs Analysis....
[Fatal Error] findbugsXml.xml:2:145: Invalid byte 2 of 4-byte UTF-8 sequence.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.539 s
[INFO] Finished at: 2017-06-09T23:31:55+02:00
[INFO] Final Memory: 64M/578M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openhab.tools:static-code-analysis:0.0.6:findbugs (default) on project org.openhab.binding.tankerkoenig: Unable to execute mojo: Invalid byte 2 of 4-byte UTF-8 sequence. -> [Help 1]

Any help would be appreciated.


(Martin van Wingerden) #55

Can you look for the "findbugsXml.xml" file on your system (I would hope target folder of your binding or maybe in the target folder of a parent), it is created by the tool and then processed at the end.

However I think it has problems with some (proper) German characters, I hope that maybe @svilenvul can take a look. Please check whether the file contains sensitive information and if not share it with us.

I assume that on one layer we are not correctly handling utf-8.


(Jürgen Baginski) #56

findbugsXml.xml (80.5 KB)
That is the file.
If it is related to German "Umlaute", I would know which, since I change based on the comment from Kai from Tankerkoenig to Tankerkönig in several spots!
[Edit]
If the Analysis Tool doesn't run through, does it make sense to commit the changes I have done at all?
In my understanding the same process is used and would result in a failed creating of the .jar.


(Martin van Wingerden) #57

I think it is was/is the one in the pom.xml, maybe you test to use another non umlaute name in the pom.xml to test?

Btw on what os are you?


(Jürgen Baginski) #58

On the spot!
With the changed pom.xml the tool is running through!
Will commit/push that change in a minute.

BTW I'm on Win10


(Svilenvul) #59

The discussion about the missing files could be continued here.


(Chris Jackson) #60

There seem to be a few things that are incorrectly throwing errors (IMHO) -:

[ERROR] .binding.zwave/build.properties:[0]
The jar file lib/junit-4.12.jar is present in the lib folder but is not present in the build properties

For ZWave this is needed as I have my tests and code in the same repository - therefore the test JARs are contained in the project, but we don’t want them in the binary. Myself and Kai spent quite some time making this work when we first split out ZWave.

[ERROR] .binding.zwave/ESH-INF/thing/_controller_serial.xml:[122]
Invalid content was found starting with element parameter-group. One of {parameter} is expected.

The xsd states the minimum number of parameter elements is 0 - not 1 -:

			<xs:element name="parameter-group" type="config-description:parameterGroup"
				minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="parameter" type="config-description:parameter"
				minOccurs="0" maxOccurs="unbounded" />

I don’t see errors in Eclipse with these files, so I guess the xsd checker being used has a bug, but this causes hundreds of errors as it’s used extensively in ZWave.