Skip to content

Commit

Permalink
Use mvn.cmd on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewillmon committed Sep 13, 2024
1 parent 9b45c37 commit ade1c2d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lockfile_generator/src/maven.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ use crate::{Error, Generator, Result};

pub struct Maven;

#[cfg(not(windows))]
fn maven_command() -> Command {
Command::new("mvn")
}

#[cfg(windows)]
fn maven_command() -> Command {
Command::new("mvn.cmd")
}

impl Generator for Maven {
fn lockfile_path(&self, manifest_path: &Path) -> Result<PathBuf> {
let project_path = manifest_path
Expand All @@ -17,7 +27,7 @@ impl Generator for Maven {

fn command(&self, manifest_path: &Path) -> Command {
let lockfile_path = self.lockfile_path(manifest_path).unwrap();
let mut command = Command::new("mvn");
let mut command = maven_command();
command.args([
"-q",
"help:effective-pom",
Expand Down

0 comments on commit ade1c2d

Please sign in to comment.