Skip to content

Commit 2d12dbc

Browse files
committed
Update plugin to support MTA-CLI 7.2.0
1 parent 7905d91 commit 2d12dbc

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'org.jboss.tools.intellij'
8-
version project.hasProperty('projectVersion') ? project.property('projectVersion') : '7.1.0'
8+
version project.hasProperty('projectVersion') ? project.property('projectVersion') : '7.2.0'
99

1010
intellij {
1111
version = project.hasProperty('ideaVersion') ? project.property('ideaVersion') : '2022.2'

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ideaVersion=2022.2
2-
projectVersion=7.1.0
2+
projectVersion=7.2.0
33
jetBrainsToken=invalid
44
jetBrainsChannel=stable

src/main/java/org/jboss/tools/intellij/windup/cli/RulesetParser.java

+14-10
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
import org.jboss.tools.intellij.windup.model.WindupConfiguration;
99
import java.io.File;
1010
import java.io.FileNotFoundException;
11+
import java.net.URISyntaxException;
1112
import java.util.ArrayList;
1213
import java.util.List;
1314
import java.util.Map;
14-
15+
import java.net.URI;
1516
public class RulesetParser {
1617

1718
public static List<Ruleset> parseRuleset(String resultFilePath) {
@@ -47,14 +48,18 @@ public static List<Ruleset> parseRuleset(String resultFilePath) {
4748
return null;
4849
}
4950

50-
public static void parseRulesetForKantraConfig (WindupConfiguration configuration){
51+
public static void parseRulesetForKantraConfig (WindupConfiguration configuration) {
5152
if (configuration.getOptions() != null){
5253
String outputLocation = configuration.getRulesetResultLocation();
5354
configuration.setRulesets(parseRuleset(outputLocation));
5455

5556
if(configuration.getSummary() != null){
5657
configuration.getSummary().setRulesets(parseRuleset(outputLocation));
57-
parseIncidents(configuration.getRulesets(), configuration);
58+
try {
59+
parseIncidents(configuration.getRulesets(), configuration);
60+
} catch (URISyntaxException e) {
61+
throw new RuntimeException(e);
62+
}
5863
// System.out.println("size of the Incident: ");
5964
// System.out.println(configuration.getSummary().getIssues().size());
6065
}else {
@@ -66,7 +71,7 @@ public static void parseRulesetForKantraConfig (WindupConfiguration configuratio
6671

6772
}
6873

69-
public static void parseIncidents (List<WindupConfiguration.Ruleset> rulesets, WindupConfiguration configuration) {
74+
public static void parseIncidents (List<WindupConfiguration.Ruleset> rulesets, WindupConfiguration configuration) throws URISyntaxException {
7075
if (rulesets != null){
7176
for (WindupConfiguration.Ruleset ruleset: rulesets){
7277
Map<String, Violation> violations = ruleset.getViolations();
@@ -81,13 +86,12 @@ public static void parseIncidents (List<WindupConfiguration.Ruleset> rulesets, W
8186
ArrayList<String> inputs = (ArrayList<String>) configuration.getOptions().get("input");
8287
String input = inputs.get(0);
8388
String filePath = incident.getUri();;
89+
URI uri = new URI(filePath);
8490
incident.ruleId = entry.getKey();
85-
//System.out.println("-----------filePath-------------: " + filePath);
86-
String absolutePath = filePath.substring(filePath.indexOf("/opt/input/source") + "/opt/input/source".length());
87-
// System.out.println("------------------ Absolute path -------------: " + input + absolutePath);
88-
incident.file = input + absolutePath;
89-
incident.setUri(input + absolutePath);
90-
// System.out.println("File path of the incidents: " + incident.file);
91+
String absolutePath = new File(uri).getAbsolutePath();
92+
incident.file = absolutePath;
93+
incident.setUri(absolutePath);
94+
//System.out.println("File path of the incidents: " + incident.file);
9195
incident.effort = String.valueOf(violation.getEffort());
9296
incident.links = violation.getLinks();
9397
incident.category = violation.getCategory();

0 commit comments

Comments
 (0)