Oliver Gierke Archive About Tags

Changing a project's artifactId in Sonar

10 June 2010

Sonar is a great tool to take care of code quality in your software projects. I use it heavily to monitor the open source projects I am involved with. When working on getting Hades published into Maven central I had to polish it’s pom.xml and felt the need to align the parent project’s artifact to our chosen OSGi compatible package notation for artifacts. So prior to releasing it to Maven central I changed the artifact id from hades-parent to org.synyx.hades.parent. Everything fine until I pushed the metrics of the 1.5.1 release into Sonar.

Sonar created a new project, as it cannot know about my refactoring. So what to do? I spoke to Simon Brandhof and apparently there’s no feature in Sonar to change the artifact id via the user interface. So I opened a JIRA issue for it, feel free to vote for it if you like. Meanwhile we could achieve this by manually altering the kee column inside the PROJECTS table. It contains entries of the form ${groupId}:${artifactId}(:${branchName}) for entries of type PRJ (i guess that stands for project. Altering these entries solved the problem.

Thanks to Simon and Verschdl for help!

blog comments powered by Disqus
Fork me on GitHub