Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project and Project Versions parameters #6

Open
ReinoutW opened this issue Jan 4, 2019 · 2 comments
Open

Project and Project Versions parameters #6

ReinoutW opened this issue Jan 4, 2019 · 2 comments

Comments

@ReinoutW
Copy link

ReinoutW commented Jan 4, 2019

I'm using the latest version of the plugin in combination with SonarQube 6.7.1, with the SonarQube Scanner for MSBuild.

In SonarQube we have defined projects (mapping to .NET solutions) and subprojects (mapping to .NET C# projects part of a solution).
In the BlackDuck hub we are using the same projects as those in SonarQube, but no subprojects (that would be too granular given that we already have 100+ SonarQube projects).

This works fine for creating static code analysis reports. When using the hub-sonarqube plugin, this results in:

[16:24:36][Step 19/30] 16:24:36.416 INFO: Gathering Hub component files...
[16:24:36][Step 19/30] 16:24:36.422 DEBUG: Default Hub Project to look for: SubProjectX1
[16:24:36][Step 19/30] 16:24:36.422 DEBUG: Default Hub Project-Version to look for: 99
[16:24:37][Step 19/30] 16:24:37.478 INFO: --> Number of local files matching inclusion/exclusion patterns: 7
[16:24:37][Step 19/30] 16:24:37.478 INFO: --> Number of vulnerable Hub component files matched: 0
[16:24:37][Step 19/30] 16:24:37.478 INFO: No comparison will be performed because at least one of the lists of components had zero entries.
[16:24:37][Step 19/30] 16:24:37.478 INFO: Sensor Black Duck Hub Plugin for SonarQube [hubsonarqube] (done) | time=10423ms
[16:24:37][Step 19/30] 16:24:37.478 INFO: Sensor C# Properties [csharp]
[16:24:37][Step 19/30] 16:24:37.477 ERROR: Problem getting BOM components: com.blackducksoftware.integration.hub.exception.DoesNotExistException: This Project does not exist. Project : SubProjectX1

From the documentation (here), I understood I could add the following properties to override project & project version:

  • sonar.hub.project.override
  • sonar.hub.project.version.override

sonar-project.properties is not supported by SonarQube Scanner for MSBuild, but what is allowed in some cases is this: https://docs.sonarqube.org/display/SCAN/Additional+Analysis+Parameters

I added the extra parameters in an ItemGroup as described on that page:

<ItemGroup>
<SonarQubeSetting Include="sonar.hub.project.override">
<Value>org.whatever.ProjectX</Value>
</SonarQubeSetting>
<SonarQubeSetting Include="sonar.hub.project.version.override">
<Value>master</Value>
</SonarQubeSetting>
</ItemGroup>

However, they seem to be ignored by the plugin. If that's not working, how can I provide the correct arguments (for project and project version) to this hub-sonarqube extension?

@luis-miguel-alves
Copy link

hi. Did you found any solution?

@cfahrenholz
Copy link

Hi, did anyone solve this? We also want to set projectVersion via csproj/props files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants