1414package org .skife .waffles ;
1515
1616import net .e175 .klaus .zip .ZipPrefixer ;
17- import org .apache .commons .io .IOUtils ;
1817import org .apache .maven .artifact .Artifact ;
1918import org .apache .maven .plugin .AbstractMojo ;
2019import org .apache .maven .plugin .MojoExecutionException ;
2423import org .apache .maven .plugins .annotations .Parameter ;
2524import org .apache .maven .project .MavenProject ;
2625import org .apache .maven .project .MavenProjectHelper ;
26+ import org .codehaus .plexus .util .IOUtil ;
2727
2828import java .io .File ;
2929import java .io .IOException ;
3535import java .nio .file .Path ;
3636import java .nio .file .Paths ;
3737import java .util .ArrayList ;
38+ import java .util .Arrays ;
3839import java .util .List ;
3940
4041import static java .lang .String .format ;
@@ -178,7 +179,8 @@ private void makeExecutable(File file)
178179
179180 Path target = file .toPath ();
180181 try {
181- ZipPrefixer .applyPrefixesToZip (target , getPreamble (target .toUri ()), "\n \n " .getBytes (UTF_8 ));
182+ ZipPrefixer .applyPrefixBytesToZip (target ,
183+ Arrays .asList (getPreamble (target .toUri ()), "\n \n " .getBytes (UTF_8 )));
182184 } catch (IOException e ) {
183185 throw new MojoExecutionException (format ("Failed to apply prefix to JAR [%s]" , file .getAbsolutePath ()), e );
184186 }
@@ -204,11 +206,10 @@ private byte[] getPreamble(URI uri) throws MojoExecutionException {
204206 if (scriptIn == null ) {
205207 throw new IOException ("unable to load " + scriptFile );
206208 }
207- return IOUtils .toByteArray (scriptIn ); // Java 9+: scriptIn.readAllBytes();
209+ return IOUtil .toByteArray (scriptIn ); // Java 9+: scriptIn.readAllBytes();
208210 }
209211 } catch (IOException e ) {
210212 throw new MojoExecutionException ("unable to load preamble data" , e );
211213 }
212214 }
213-
214215}
0 commit comments