title: Automatically derive mandatory SonarQube properties from pom file in Jenkins
body: <p><strong>Situation:</strong></p>
  
  <p>I want to analyze my project with SonarQube (5.4) triggered by Jenkins (1.642.4). It is a java project build with maven.</p>
  
  <p>I see two ways to trigger the analysis:</p>
  
  <ol>
  <li>Post Build Action "SonarQube analysis with maven" but it's <strong>deprecated</strong>, so I don't want to use it</li>
  <li>Post Build Step "Execute SonarQube Scanner", is the recommended way.</li>
  </ol>
  
  <p><strong>Problem:</strong></p>
  
  <p>If I use the deprecated Post Build Action, the properties for sonar project configuration are derived automatically from the project pom.</p>
  
  <p>It I use the recommended Post Build Step, I receive the Exception </p>
  
  <blockquote>
    <p>You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources</p>
  </blockquote>
  
  <p><strong>Undesired Solution</strong>:</p>
  
  <p>The solution is to provide the required properties, via sonar-project.properties file in the java project or via parameters in Jenkins step.</p>
  
  <p>IMHO: this is duplication. All relevant information is defined in the Maven pom: projectKey can be derived from artifactId, projectName and projectVerstion are same properties in maven. Especially the projectVersion is critical. I don't want to update the project version after each release (or write some code in release plugin to update it automatically).</p>
  
  <p><strong>What I want</strong></p>
  
  <p>I want to use the recommended Post Build Step in Jenkins, without redefine all project properties for all my project to make sonar happy. Instead sonar/jenkins/plugin/whatever should derive the properties from my maven pom file. Is there an additional plugin I can use? Can I reconfigure my Jenkins-Sonar-Plugin?</p>
  
  <p>I don't want to provide any sonar specific information in my pom/project, because the project shouldn't care about sonar. It should contain only information required to build the project.</p>