File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/com/amashchenko/maven/plugin/gitflow Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2525import java .util .TimeZone ;
2626import java .util .regex .Pattern ;
2727
28+ import org .apache .commons .lang3 .SystemUtils ;
2829import org .apache .maven .artifact .ArtifactUtils ;
2930import org .apache .maven .execution .MavenSession ;
3031import org .apache .maven .model .Dependency ;
@@ -205,7 +206,14 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo {
205206 private void initExecutables () {
206207 if (StringUtils .isBlank (cmdMvn .getExecutable ())) {
207208 if (StringUtils .isBlank (mvnExecutable )) {
208- mvnExecutable = "mvn" ;
209+ final String javaCommand = mavenSession .getSystemProperties ().getProperty ("sun.java.command" , "" );
210+ final boolean wrapper = javaCommand .startsWith ("org.apache.maven.wrapper.MavenWrapperMain" );
211+
212+ if (wrapper ) {
213+ mvnExecutable = "." + SystemUtils .FILE_SEPARATOR + "mvnw" ;
214+ } else {
215+ mvnExecutable = "mvn" ;
216+ }
209217 }
210218 cmdMvn .setExecutable (mvnExecutable );
211219 }
You can’t perform that action at this time.
0 commit comments