Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ow2
OW2 MRL
Commits
b565b563
Commit
b565b563
authored
Jul 26, 2021
by
Antoine Mottier
Browse files
Merge branch 'componentKey-fix' into 'master'
Attempt to solve
#104
componentKey See merge request
!20
parents
b1a5b34d
4856d599
Pipeline
#15003
passed with stages
in 1 minute and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
data-collection/src/main/java/org/ow2/mrl/data/collect/MainCollector.java
View file @
b565b563
...
...
@@ -398,9 +398,9 @@ public class MainCollector {
}
/**
* Retrieves sonar component
key
* Retrieves sonar component
* @param project The project name
* @return The sonarqube component
Key
(or Id)
* @return The sonarqube component (or Id)
*/
public
String
getSonarqubeId
(
String
project
)
{
return
trim
(
config
.
getProperty
(
project
+
".sonarqube"
));
...
...
@@ -561,15 +561,15 @@ public class MainCollector {
* @return Script part to gather SonarQube data (single project)
*/
public
String
generateSonarScript
(
String
project
)
{
String
component
Key
=
getSonarqubeId
(
project
);
String
component
=
getSonarqubeId
(
project
);
String
server
=
getSonarqubeServer
(
project
);
String
credentials
=
getSonarqubeCredentials
(
project
);
if
(
credentials
.
length
()
>
0
)
credentials
=
" -u "
+
credentials
;
if
(
component
Key
==
null
)
return
null
;
if
(
component
==
null
)
return
null
;
else
{
return
"curl -X GET"
+
credentials
+
" -H \"Content-Type: application/json\" '"
+
complementUrl
(
server
,
"/api/measures/component?metricKeys=coverage,blocker_violations,critical_violations,test_success_density,ncloc&component
Key
="
)
+
component
Key
+
"' > "
+
getOutputDir
(
true
)
+
project
+
"_sonar.json"
;
+
complementUrl
(
server
,
"/api/measures/component?metricKeys=coverage,blocker_violations,critical_violations,test_success_density,ncloc&component="
)
+
component
+
"' > "
+
getOutputDir
(
true
)
+
project
+
"_sonar.json"
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment