Skip to content

Commit e9558e8

Browse files
committed
fix: support windows binary for maven
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent 6d4c55c commit e9558e8

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

src/main/java/com/redhat/exhort/providers/JavaMavenProvider.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@
1515
*/
1616
package com.redhat.exhort.providers;
1717

18-
import static com.redhat.exhort.impl.ExhortApi.debugLoggingIsNeeded;
19-
20-
import com.github.packageurl.MalformedPackageURLException;
21-
import com.github.packageurl.PackageURL;
22-
import com.redhat.exhort.Api;
23-
import com.redhat.exhort.Provider;
24-
import com.redhat.exhort.logging.LoggersFactory;
25-
import com.redhat.exhort.sbom.Sbom;
26-
import com.redhat.exhort.sbom.SbomFactory;
27-
import com.redhat.exhort.tools.Ecosystem.Type;
28-
import com.redhat.exhort.tools.Operations;
29-
import com.redhat.exhort.utils.Environment;
3018
import java.io.IOException;
3119
import java.nio.file.Files;
3220
import java.nio.file.Path;
@@ -39,11 +27,24 @@
3927
import java.util.TreeMap;
4028
import java.util.logging.Logger;
4129
import java.util.stream.Collectors;
30+
4231
import javax.xml.stream.XMLInputFactory;
4332
import javax.xml.stream.XMLStreamConstants;
4433
import javax.xml.stream.XMLStreamException;
4534
import javax.xml.stream.XMLStreamReader;
4635

36+
import com.github.packageurl.MalformedPackageURLException;
37+
import com.github.packageurl.PackageURL;
38+
import com.redhat.exhort.Api;
39+
import com.redhat.exhort.Provider;
40+
import static com.redhat.exhort.impl.ExhortApi.debugLoggingIsNeeded;
41+
import com.redhat.exhort.logging.LoggersFactory;
42+
import com.redhat.exhort.sbom.Sbom;
43+
import com.redhat.exhort.sbom.SbomFactory;
44+
import com.redhat.exhort.tools.Ecosystem.Type;
45+
import com.redhat.exhort.tools.Operations;
46+
import com.redhat.exhort.utils.Environment;
47+
4748
/**
4849
* Concrete implementation of the {@link Provider} used for converting dependency trees for Java
4950
* Maven projects (pom.xml) into a content Dot Graphs for Stack analysis or Json for Component
@@ -54,7 +55,7 @@ public final class JavaMavenProvider extends BaseJavaProvider {
5455
private static final String PROP_JAVA_HOME = "JAVA_HOME";
5556
private static final Logger log = LoggersFactory.getLogger(JavaMavenProvider.class.getName());
5657
private final String mvnExecutable;
57-
private static final String MVN = "mvn";
58+
private static final String MVN = isWindows() ? "mvn" : "mvn.cmd";
5859
private static final String ARG_VERSION = "-v";
5960

6061
public JavaMavenProvider(Path manifest) {

0 commit comments

Comments
 (0)