File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,24 @@ impl MavenPlugin {
5151 }
5252 log:: debug!( "could not execute mvn" ) ;
5353 let tmc_path = dirs:: cache_dir ( ) . ok_or ( JavaError :: CacheDir ) ?. join ( "tmc" ) ;
54- let mvn_exec = tmc_path. join ( "apache-maven-3.6.3" ) . join ( "bin" ) . join ( "mvn" ) ;
55- if !mvn_exec. exists ( ) {
54+
55+ #[ cfg( windows) ]
56+ let mvn_exec = "mvn.cmd" ;
57+ #[ cfg( not( windows) ) ]
58+ let mvn_exec = "mvn" ;
59+
60+ let mvn_exec_path = tmc_path
61+ . join ( "apache-maven-3.6.3" )
62+ . join ( "bin" )
63+ . join ( mvn_exec) ;
64+ if !mvn_exec_path. exists ( ) {
5665 log:: debug!( "extracting bundled tar" ) ;
5766 let tar = GzDecoder :: new ( Cursor :: new ( MVN_ARCHIVE ) ) ;
5867 let mut tar = Archive :: new ( tar) ;
5968 tar. unpack ( & tmc_path)
6069 . map_err ( |e| JavaError :: MvnUnpack ( tmc_path, e) ) ?;
6170 }
62- Ok ( mvn_exec . as_os_str ( ) . to_os_string ( ) )
71+ Ok ( mvn_exec_path . as_os_str ( ) . to_os_string ( ) )
6372 }
6473}
6574
You can’t perform that action at this time.
0 commit comments