PMD plugin

62 views
Skip to first unread message

Tim Webster

unread,
May 7, 2016, 11:38:47 AM5/7/16
to SonarQube
Hello,

I've agreed to maintain the PMD plugin, so I have a bunch of questions for those that have worked on it previously.

  • I can manage the Github releases OK, but what about releasing to Maven Central?  Do I just create/use my own account and manage it myself?
  • The integration tests:
    • are they meant to run against a running server?  It's not clear how they are supposed to be run (i.e. a clean install doesn't work, and it looks like some configuration needs to be provided)
    • Do they work?  Are they typically run before each release?
  • I'm wondering about server/Java plugin compatibility.  Currently it's built against server 4.5.4 and Java 3.6. It works OK, but when do we think about upgrading it?
  • Where does the update centre pick up the latest release from?  Github or Maven Central?

Thanks all for now...

Thanks,

Tim

Tim Webster

unread,
May 14, 2016, 11:33:56 AM5/14/16
to SonarQube
Hi -

A reminder in case anyone can answer any of these questions...:-)

The most import one is regarding the deployment of the release.  Currently the parent POM of the project has Bintray in <distributionManagement>, which is where the artifacts will be uploaded upon release.  Is that actually where they should go?  If so what do I need for credentials?

Or I could put in them maven central - after that I guess someone from SonarSource needs to do something to add them to the update centre...

Thanks,

Tim

G. Ann Campbell

unread,
May 17, 2016, 9:24:31 AM5/17/16
to SonarQube
Hi Tim,

Most community plugin maintainers create Releases on GitHub and upload the artifacts there. The Bintray stuff you're seeing in the POM is probably just a holdover from before we released the plugin to the community.

Once you create a new release, you'll announce it & ask us to put it in the update center. Since the release announcement will include where you can download the artifact from (as well as a changelog link, and brief description, I hope :-)) that's the URL we'll use to post the new version to the update center. And voila!


:-)
Ann 

Nicolas Peru

unread,
May 17, 2016, 9:46:14 AM5/17/16
to Tim Webster, SonarQube
Hi Tim ! 

Ann just answered release and update center questions, so i'll focus on the other two: 

 - Integration Tests : yes they work, they are meant to be run on their own but they rely on a tool called Orchestrator which requires some configuration : 

   basically an env variable $ORCHESTRATOR_CONFIG_URL pointing to a property file containing at least the following keys   : 

# Path to maven can also be set with the env variable MAVEN_HOME
maven.home=/usr/local/apache-maven/apache-maven-3.3.3

# Location of Maven local repository is not automatically guessed. It can also be set with the env variable MAVEN_LOCAL_REPOSITORY.
maven.localRepository=/home/nicolasperu/.m2/repository
# Version of SonarQube, for example "4.2" or "4.3-SNAPSHOT".
# Aliases are also supported :
# - DEV, LTS, LATEST_RELEASE for fixed versions
# - LTS_OR_OLDEST_COMPATIBLE only when version of main plugin is fixed.
sonar.runtimeVersion=LATEST_RELEASE
javaVersion=3.13.1
pmdVersion=DEV

sonar.jdbc.dialect=h2

Let me apologize in advance as this might not be complete at all and is probably going to be a pain to configure. I am not the expert on that topic so I do hope some other devs to weigh in with complementary information. 

And so yes, they were run before each release to ensure no breaking of backward compatibility. 


- About compatibility of plugin with java and sonarqube API :  it is really up to maintainer of the project to decide when to break compatibility with dependencies, for java it is not a big deal but for SQ it is generally a good idea to break compatibility from an LTS to another LTS to limit impact on users.

HTH, 

Cheers, 



--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/470bf04f-cc08-48e5-a3a4-3d2128ca5027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com

Tim Webster

unread,
May 17, 2016, 11:32:26 AM5/17/16
to SonarQube, tim.w...@gmail.com
OK - thanks Nicolas, Anne for your replies..:-)

im

Tim Webster

unread,
May 21, 2016, 12:34:48 PM5/21/16
to SonarQube
Hi Nicolas,

OK that helped a bit, but next problem is this.  It seems to be downloading a list of properties from update.sonarsource.org and 'devVersion' isn't in it.  Any ideas?  Cheers..

java.lang.ExceptionInInitializerError
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:142)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
at java.lang.reflect.Field.get(Field.java:393)
at org.junit.runners.model.FrameworkField.get(FrameworkField.java:69)
at org.junit.runners.model.TestClass.getAnnotatedFieldValues(TestClass.java:156)
at org.junit.runners.ParentRunner.classRules(ParentRunner.java:215)
at org.junit.runners.ParentRunner.withClassRules(ParentRunner.java:203)
at org.junit.runners.ParentRunner.classBlock(ParentRunner.java:163)
at org.junit.runners.ParentRunner.run(ParentRunner.java:308)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.IllegalStateException: devVersion should be defined
at org.sonar.updatecenter.common.UpdateCenterDeserializer.reportError(UpdateCenterDeserializer.java:167)
at org.sonar.updatecenter.common.UpdateCenterDeserializer.reportUndefined(UpdateCenterDeserializer.java:409)
at org.sonar.updatecenter.common.UpdateCenterDeserializer.get(UpdateCenterDeserializer.java:415)
at org.sonar.updatecenter.common.UpdateCenterDeserializer.parseSonarDevVersions(UpdateCenterDeserializer.java:273)
at org.sonar.updatecenter.common.UpdateCenterDeserializer.parseSonar(UpdateCenterDeserializer.java:267)
at org.sonar.updatecenter.common.UpdateCenterDeserializer.fromProperties(UpdateCenterDeserializer.java:137)
at org.sonar.updatecenter.common.UpdateCenterDeserializer.fromSingleFile(UpdateCenterDeserializer.java:106)
at com.sonar.orchestrator.OrchestratorBuilder.getUpdateCenter(OrchestratorBuilder.java:169)
at com.sonar.orchestrator.OrchestratorBuilder.resolvePluginVersion(OrchestratorBuilder.java:156)
at com.sonar.orchestrator.OrchestratorBuilder.getPluginRelease(OrchestratorBuilder.java:139)
at com.sonar.orchestrator.OrchestratorBuilder.getPluginVersion(OrchestratorBuilder.java:121)
at com.sonar.orchestrator.OrchestratorBuilder.addPlugin(OrchestratorBuilder.java:233)
at com.sonar.it.java.suite.PmdTestSuite.<clinit>(PmdTestSuite.java:37)
... 22 more

Michael Gumowski

unread,
May 23, 2016, 2:53:15 AM5/23/16
to Tim Webster, SonarQube
Hey Tim, 

You won't be able to test your plugin against DEV version of SonarQube (which is the current version under development, and therefore not yet public). 
Into your orchestrator file, you should set property sonar.runtimeVersion only to version LTS or LATEST_RELEASE.

Cheers,

Michael GUMOWSKI | SonarSource
Software Developer @ Language Team
http://sonarsource.com

Tim Webster

unread,
May 23, 2016, 7:04:35 AM5/23/16
to Michael Gumowski, SonarQube
Hi Michael.

Thanks for that, however I didn't change any of the values that Nicolas provided, so I'm using this:

sonar.runtimeVersion=LATEST_RELEASE


The way the Orchestrator is building the UpdateCenterDeserializer, MODE is hard-coded to Mode.DEV.

I need to look at it some more, but it's hard to see how this hasn't always been the case...

Thanks
Reply all
Reply to author
Forward
0 new messages