[ 
https://issues.apache.org/jira/browse/MSHARED-1203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731337#comment-17731337
 ] 

ASF GitHub Bot commented on MSHARED-1203:
-----------------------------------------

elharo commented on code in PR #24:
URL: 
https://github.com/apache/maven-file-management/pull/24#discussion_r1225790726


##########
src/test/java/org/apache/maven/shared/model/fileset/util/FileSetUtilsTest.java:
##########
@@ -269,23 +262,19 @@ void testDeleteDontFollowSymlinksButDeleteThem() throws 
Exception {
         assertFalse(new File(directory, "dir1").exists(), "included directory 
has not been deleted");
     }
 
-    private boolean createSymlink(File target, File link) throws 
InterruptedException, CommandLineException {
-
+    private void createSymlink(File target, File link) {
         if (link.exists()) {
             link.delete();
         }
 
-        Commandline cli = new Commandline();
-        cli.setExecutable("ln");
-        cli.createArg().setValue("-s");
-        cli.createArg().setValue(target.getPath());
-        cli.createArg().setValue(link.getPath());
-
-        int result = cli.execute().waitFor();
-
-        linkFiles.add(link);
-
-        return result == 0;
+        try {
+            Files.createSymbolicLink(link.toPath(), target.toPath());
+            linkFiles.add(link);

Review Comment:
   good point. done





> Use Files.createSymbolicLink from Java 7
> ----------------------------------------
>
>                 Key: MSHARED-1203
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1203
>             Project: Maven Shared Components
>          Issue Type: Improvement
>          Components: file-management
>            Reporter: Elliotte Rusty Harold
>            Assignee: Elliotte Rusty Harold
>            Priority: Minor
>             Fix For: file-management-3.1.1
>
>
> Instead of the massive hack in FileSetUtilsTest.java



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to