Note that there are some explanatory texts on larger screens.

plurals
  1. PORetaining module keys when migrating Sonar from Maven runner to Ant runner
    text
    copied!<p>We'd like to convert our existing multi-module Sonar projects that use the Maven runner to use the Ant runner instead. These projects all use Ant for their main build anyway, and it will be a lot more convenient to have everything done with Ant.</p> <p>We must preserve the history of the projects, meaning that we need to retain the keys used for the projects and their modules. I'm having trouble doing that.</p> <p>Our current Maven parent pom looks something like this (the ui is similar, though the language is Flex):</p> <pre><code>&lt;project ...&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.example&lt;/groupId&gt; &lt;artifactId&gt;anapp&lt;/artifactId&gt; &lt;name&gt;An Application&lt;/name&gt; &lt;version&gt;7.0&lt;/version&gt; &lt;packaging&gt;pom&lt;/packaging&gt; &lt;modules&gt; &lt;module&gt;server&lt;/module&gt; &lt;module&gt;ui&lt;/module&gt; &lt;/modules&gt; &lt;properties&gt; &lt;sonar.dynamicAnalysis&gt;reuseReports&lt;/sonar.dynamicAnalysis&gt; &lt;/properties&gt; &lt;/project&gt; </code></pre> <p>The server module pom looks like this:</p> <pre><code>&lt;project ...&gt; &lt;parent&gt; &lt;groupId&gt;com.example&lt;/groupId&gt; &lt;artifactId&gt;anapp&lt;/artifactId&gt; &lt;version&gt;7.0&lt;/version&gt; &lt;/parent&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.example&lt;/groupId&gt; &lt;artifactId&gt;anapp_server&lt;/artifactId&gt; &lt;name&gt;Server&lt;/name&gt; &lt;version&gt;7.0&lt;/version&gt; &lt;build&gt; &lt;outputDirectory&gt;build/classes&lt;/outputDirectory&gt; &lt;sourceDirectory&gt;src/main/java&lt;/sourceDirectory&gt; &lt;testOutputDirectory&gt;build/test/classes&lt;/testOutputDirectory&gt; &lt;testSourceDirectory&gt;src/test&lt;/testSourceDirectory&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;properties&gt; &lt;sonar.dynamicAnalysis&gt;reuseReports&lt;/sonar.dynamicAnalysis&gt; &lt;sonar.core.codeCoveragePlugin&gt;emma&lt;/sonar.core.codeCoveragePlugin&gt; &lt;sonar.emma.reportPath&gt;build\codecoverage-results&lt;/sonar.emma.reportPath&gt; &lt;sonar.surefire.reportsPath&gt;build\test\results&lt;/sonar.surefire.reportsPath&gt; &lt;/properties&gt; &lt;/project&gt; </code></pre> <p>We set the sonar.branch property on the command line to "R7".</p> <p>The key of the "myapp" project looks like</p> <pre><code>com.example:anapp:R7 </code></pre> <p>The key of the "Server" module within the "myapp" project looks like this:</p> <pre><code>com.example:anapp_server:R7 </code></pre> <p>For the same project to use the Ant task, I set up the properties as:</p> <pre><code>sonar.dynamicAnalysis=reuseReports sonar.modules=server,ui sonar.projectBaseDir=... sonar.projectKey=com.example\:myapp sonar.projectName=An Application sonar.projectVersion=7.0 server.sonar.binaries=... server.sonar.dynamicAnalysis=reuseReports server.sonar.emma.reportPath=... server.sonar.java.coveragePlugin=emma server.sonar.java.source=1.6 server.sonar.language=java server.sonar.libraries=... server.sonar.projectBaseDir=... server.sonar.projectKey=com.example\:anapp_server server.sonar.projectName=Server server.sonar.sources=... server.sonar.surefire.reportsPath=... server.sonar.tests=... ui.sonar.dynamicAnalysis=false ui.sonar.language=flex ui.sonar.projectBaseDir=... ui.sonar.projectKey=com.example\:anapp_ui ui.sonar.projectName=UI ui.sonar.sources=... </code></pre> <p>The key of the project looks the same as with the pom file ("com.example:anapp:R7"); however, the server module key looks like</p> <pre><code>com.example:anapp:com.example:anapp_server:R7 </code></pre> <p>This difference will cause us to lose the history of the modules if I publish using them.</p> <p>Is there a way for me to specify the Ant properties to generate the same key as with our existing Maven pom files?</p> <p>Our Sonar admin tells me he can manually change the keys for us, but this would be tedious and time consuming. We'll resort to that if we have to, but I'm hoping I'm just missing something obvious that would save us a lot of work.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload