custom rules are not shown in the dashboard - java

I'm writing a custom rules for java, following the tutorial http://docs.sonarqube.org/display/PLUG/Writing+Custom+Java+Rules+101
I've build the maven project successfully, and moved the jar to the folder /extenstions/plugins/ ,and I restarted the sonar service, but I cannot find out the rule I wrote in the rules page.
I thought about I have the wrong version of the software. I've checked the version I use. sonarqube is 5.3, sonarscanner is 2.5, java version is 1.8, maven version is 3.0.5. I've downloaded the java-plugin-4.1.jar from the website and put it into the folder /extensions/plugins/

Finally Like Michael said the java-plugin version and the sonarqube version doesn't match very well. I upgraded the sonarqube and mysql, the rule finally come into effect. Thank you Michael.

Related

Why is IntelliJ IDEA unable to determine java version?

I'm rather new to IntelliJ IDEA and Grails in general. I just started a new Project, selected my project JDK (11.0.1) and Gradle distribution (4.10.2). Whenever I try to run the project, I get this error:
Error initializing classpath: Could not determine java version from
'11.0.1'. java.lang.IllegalArgumentException: Could not determine java
version from '11.0.1'. at
org.gradle.api.JavaVersion.toVersion(JavaVersion.java:68) at
org.gradle.api.JavaVersion.current(JavaVersion.java:78) at
org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at
org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:66)
at
org.gradle.tooling.internal.consumer.ConnectorServices.close(ConnectorServices.java:53)
at
org.gradle.tooling.internal.consumer.DefaultGradleConnector.close(DefaultGradleConnector.java:57)
at
org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:78)
at
org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:525)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:508)
at
org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:306)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:269) at
org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
All other discussions of the problem I found suggested changing the Gradle distribution, which I already did. I would be so happy if anybody could help me out here.
Cheers!
May be your java configuration is not correct. If not correct follow this steps.
Goto File-> Project Structure.
Change SDK
Or gradle version is not matching jdk 11 then skip this answer.
Besides the issue with Gradle above, if you're trying to run a Grails project I don't think you can do that with JDK higher than version 8.
Even the latest Grails (3.3.8 as of this writing) is still based on SpringBoot 1.5 which does not support newer JDK, I don't know if there's a special trick to make it work.
I had to delete the .gradle directory and restart Intellij.

Cannot build JXBrowser jar with v6.18+

I am getting some errors that had been fixed according to the 6.18 release notes and was hoping to bump the dependency version to fix the issue, but when I mvn install the project now, I get a build error
Classes found in the wrong directory: {META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper$1.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper$1, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/NativeLinux.class=com.teamdev.jxbrowser.chromium.swing.internal.NativeLinux, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/NativeMac.class=com.teamdev.jxbrowser.chromium.javafx.internal.NativeMac, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/dialogs/ColorDialog.class=com.teamdev.jxbrowser.chromium.javafx.internal.dialogs.ColorDialog, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/JavaVersion.class=com.teamdev.jxbrowser.chromium.internal.JavaVersion, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/Native.class=com.teamdev.jxbrowser.chromium.swing.internal.Native, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/X509CertificateFactory.class=com.teamdev.jxbrowser.chromium.internal.X509CertificateFactory, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper$InstanceHolder.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper$InstanceHolder, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/Native.class=com.teamdev.jxbrowser.chromium.javafx.internal.Native, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/OS.class=com.teamdev.jxbrowser.chromium.internal.OS}
I have cleared my maven cache and tried versions 6.18-6.20 but I can only build with 6.17 and below. My license file claims to work for versions 6.X, so I would assume that is not the issue.
Thanks!
Starting from the version 6.18, JxBrowser provides multi-release jars, so it is able to work with both Java 8 and Java 9. And it seems that the maven used to build the application does not support the MR-JAR's, so it generates a build error. So you need to upgrade Maven version.

Is there a way to get a map of maven plugin version and their required java version?

I'm maintaining a parent pom for my team which will provide the latest compatible version of various maven plugins per the JDK that the project uses. Sometimes if a project utilizes an older version of Java (like 1.5) maven will fail due to a plugin requiring a newer version. Is there a way to get a map of a given plugin and see what the minimum java version is for said plugin? I was thinking there was some sort of report or something that would show me that, but I'm not seeing anything.
What about: https://builds.apache.org/view/M-R/view/Maven/job/dist-tool-plugin/site/dist-tool-prerequisites.html Apart from that on every plugin page you can find the goals page which contains the information you need. One more thing if you are using not the most uptodate versions all older versions pages are available where you can look at which version which JDK versions uses. It shouldn't be problem to write some kind of script to programmatically extract the information of the older plugins. The above site contains the informations of the uptodate plugins.
Apart from that plugin version selection basead on JDK version is not a good idea. The plugins have only a minimum version for JDK they need to run with. Apart from that they run on all versions (already on JDK 9 with one exception)...Furthermore plugins might require a minimum Maven version to run with which is either Maven 2.2.1 or Maven 3.0+ which shouldn't a problem.
You should define your plugins versions simply based on problems you might have but i would recommend to keep uptodate with your plugins.
If you need running you build with JDK 6 for example, but you use Maven 3.3.X which needs JDK 7 to run you can achieve this by using toolchain to handle this situation.
In theory this shouldn't be an issue. Maven will use the Java version you run it with, so the plugin's dependency will be satisfied, independent of the project's language level. Just make sure your devs are using a current version.
Example: running Maven with Java 8 will satisfy the dependency of a Plugin that requires Java 8, independent of the project's source and target level.
(With dependencies it's more complicated, I am afraid, but since you are not actually coding against your plugins, you should be fine)

Installing Groovy 1.8 on Spring Tool Suite 3.6.1

I have Spring Tool Suite 3.6.1, which is based on Eclipse 4.4.
I installed the version of Grails I need, but I noticed that the Groovy compiler is at 2.3, whereas I need it to be at 1.8.
I've gone to dist.springsource.org on the Eclipse Marketplace to look for the Compiler 1.8. I can install it, but it automatically uninstalls the existing Grails IDE. On top of that, it doesn't appear under Preferences - Groovy - Compiler and I don't seem to be able to select it.
What am I doing wrong? Do I need to use an earlier version of the Spring Tool Suite to access this particular compiler?
I'd recommend using the snapshot update site to get the latest groovy-eclipse: http://dist.springsource.org/snapshot/GRECLIPSE/e4.4/
That includes the 1.8 compiler and the latest groovy-eclipse 2.9.1 builds that work with it - the 2.9.0 release had trouble with groovy 1.8. (But 1.8 is getting quite old now so we may drop support in the not too distant future).
That snapshot build should also be compatible with grails-ide, not sure why it would be uninstalling grails-ide (but remember that grails-ide is different to the grails-runtime - have you definitely installed both from the dashboard extensions page or just the runtime?)

What Maven 3 archetype to use for Drools project on Jboss?

Objective is to set up developer environment for:
JBoss 7.1, Maven 3.04, Drools 5.3.0 , eclipse platform 3.72 (IDE for Java EE 1.4.2...)
Goal is to be able to follow tutorials and learn Drools using latest available versions of software - without running into version incompatibilities between different components.
Seem to be getting a lot of "missing reference" type errors in eclipse package explorer after compiling code examples in maven. I am a newbie so apologies in advance if this is an obvious question.
Examples appear to compile in maven fine, but when trying to integrate with Eclipse ide am having a lot of reference errors. The version of Java SDK on my PC is 1.7.0_04.
There is no official maven archetype for Drools, and I doubt that any of the community ones are up to date.
Take a look at these resources:
Drools and jBPM version compatibility matrix
On the download page, section "Eclipse update site". IIRC, in 5.3 the plugin was part of JBoss Tools, but for 5.4 it's a separate update site as linked there.
Alternatively to using the 5.4 update site, you can download the droolsjbpm tools zip (5.4 or 5.3), unzip it and configure the plugin in eclipse as a local update site.
PS: I recommend upgrading everything to 5.4.0.Final, that's the latest and greatest community release.

Categories