protected void configureSourcesAndBinariesProperties(Version sonarQubeVersion, Properties properties) { SourceGroup mainSourceGroup = getMainSourceGroup(); if (mainSourceGroup != null) { String sourcePath = mainSourceGroup.getRootFolder().getPath(); if (SonarMvnProject.isMvnProject(projectContext.getProject()) && sonarQubeVersion.compareTo(4, 5) >= 0) { sourcePath = "pom.xml," + sourcePath; } ClassPath classPath = ClassPath.getClassPath(projectContext.getProject().getProjectDirectory(), ClassPath.COMPILE); if (classPath != null) { properties.setProperty(getPropertyName("sonar.java.libraries"), getLibrariesPath(classPath)); } properties.setProperty(getPropertyName("sonar.sources"), sourcePath); URL[] roots = BinaryForSourceQuery.findBinaryRoots(mainSourceGroup.getRootFolder().toURL()).getRoots(); if (roots.length > 0) { properties.setProperty(getPropertyName("sonar.java.binaries"), Utilities.toFile(roots[0]).getPath()); } URL[] testSources = UnitTestForSourceQuery.findUnitTests(mainSourceGroup.getRootFolder()); if (testSources != null && testSources.length != 0) { File testsDir = FileUtil.archiveOrDirForURL(testSources[0]); if (testsDir.exists()) { properties.setProperty(getPropertyName("sonar.tests"), testsDir.getPath()); } } } }