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
4856d599
Commit
4856d599
authored
Jul 23, 2021
by
Martin Hamant
💬
Browse files
Attempt to solve
#104
componentKey
parent
b1a5b34d
Pipeline
#14946
passed with stages
in 1 minute and 37 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 @
4856d599
...
...
@@ -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