File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,24 @@ public void execute()
146146 }
147147
148148 mavenVersion = getVersion ( mavenVersion , Maven .class , "org.apache.maven/maven-core" );
149+
150+ try {
151+ File downloaderClass = basedir .toPath ().resolve (".mvn/wrapper/MavenWrapperDownloader.class" ).toFile ();
152+ if ( downloaderClass .exists () ) {
153+ downloaderClass .delete ();
154+ }
155+ if ( ! "source" .equals ( distributionType ) ) {
156+ File downloaderJava = basedir .toPath ().resolve (".mvn/wrapper/MavenWrapperDownloader.class" ).toFile ();
157+ if ( downloaderJava .exists () ) {
158+ downloaderJava .delete ();
159+ }
160+ }
161+ }
162+ catch ( Exception e )
163+ {
164+ throw new MojoExecutionException ( "distributionType can't clean up MavenWrapperDownloader" , e );
165+ }
166+
149167 try
150168 {
151169 replaceProperties ( wrapperVersion , Files .createDirectories ( basedir .toPath ().resolve ( ".mvn/wrapper" ) ) );
You can’t perform that action at this time.
0 commit comments