@@ -149,15 +149,27 @@ public static Optional<RepoTool> obtainTool(String folderName){
149149 return Optional .empty ();
150150 }
151151
152- private void moveJars () throws IOException {
153- Path jar = Files .move (
154- Paths .get (System .getProperty ("user.dir" ) + "/" + this .name + "/target/" + this .name + "-1.0.6-SNAPSHOT.jar" ),
155- Paths .get (System .getProperty ("user.dir" ) + "/artifacts/output/" + this .name + "-1.0.6-SNAPSHOT.jar" ),
156- StandardCopyOption .REPLACE_EXISTING );
157- Path testJar = Files .move (
158- Paths .get (System .getProperty ("user.dir" ) + "/" + this .name + "/target/" + this .name + "-1.0.6-SNAPSHOT-tests.jar" ),
159- Paths .get (System .getProperty ("user.dir" ) + "/artifacts/output/" + this .name + "-1.0.6-SNAPSHOT-tests.jar" ),
160- StandardCopyOption .REPLACE_EXISTING );
152+ private void moveJars () throws IOException {
153+ Path sourceDir = Paths .get (System .getProperty ("user.dir" ), getProjectDir (), "target" );
154+ Path targetDir = Paths .get (System .getProperty ("user.dir" ), "artifacts" , "output" );
155+
156+ // @todo may want to be able to override this in the yaml file on a project basis...
157+ String depGlob = this .name + "*-with-dependencies.jar" ;
158+ String testGlob = this .name + "*-tests.jar" ;
159+
160+ moveFiles (sourceDir , targetDir , depGlob );
161+ moveFiles (sourceDir , targetDir , testGlob );
162+ }
163+
164+ private void moveFiles (Path sourceDir , Path targetDir , String glob ) throws IOException {
165+ try (DirectoryStream <Path > dirStream = Files .newDirectoryStream (sourceDir , glob )) {
166+ for (Path source : dirStream ) {
167+ Files .move (
168+ source ,
169+ targetDir .resolve (source .getFileName ()),
170+ StandardCopyOption .REPLACE_EXISTING );
171+ }
172+ }
161173 }
162174
163175 private void moveJacoco (String property , long timeElapsed ) throws IOException {
0 commit comments