pom.setArtifactId(keys[1]);
pom.setVersion(getPropertyOrDie(properties, CoreProperties.PROJECT_VERSION_PROPERTY));
+ pom.setName(properties.getProperty(CoreProperties.PROJECT_NAME_PROPERTY, "Unnamed - " + key));
+ pom.setDescription(properties.getProperty(CoreProperties.PROJECT_DESCRIPTION_PROPERTY, ""));
+
pom.getModel().setProperties(properties);
pom.setArtifacts(Collections.EMPTY_SET);
assertThat(pom.getBasedir(), is(project.getBaseDir()));
assertThat(pom.getGroupId(), is("org.example"));
assertThat(pom.getArtifactId(), is("example"));
+ assertThat(pom.getName(), is("Unnamed - org.example:example"));
+ assertThat(pom.getDescription(), is(""));
assertThat(pom.getProperties(), is(project.getProperties()));
assertThat(pom.getBasedir(), is(project.getBaseDir()));
String buildDirectory = project.getWorkDir().getAbsolutePath() + "/target";
assertThat(pom.getReporting().getOutputDirectory(), is(buildDirectory + "/site"));
}
+ @Test
+ public void nameAndDescription() {
+ createRequiredProperties();
+
+ properties.setProperty(CoreProperties.PROJECT_NAME_PROPERTY, "Foo");
+ properties.setProperty(CoreProperties.PROJECT_DESCRIPTION_PROPERTY, "Bar");
+
+ MavenProject pom = create();
+
+ assertThat(pom.getName(), is("Foo"));
+ assertThat(pom.getDescription(), is("Bar"));
+ }
+
@Test
public void sourceDirectories() {
createRequiredProperties();
*/
String PROJECT_KEY_PROPERTY = "sonar.projectKey";
+ /**
+ * @since 2.6
+ */
+ String PROJECT_NAME_PROPERTY = "sonar.projectName";
+
+ /**
+ * @since 2.6
+ */
+ String PROJECT_DESCRIPTION_PROPERTY = "sonar.projectDescription";
+
/**
* To determine value of this property use {@link ProjectFileSystem#getSourceCharset()}.
*