Skip to content

Commit

Permalink
[KARAF-3805] Fix assembly library support on windows by not using sym…
Browse files Browse the repository at this point in the history
…bolic links
  • Loading branch information
gnodet committed Jul 9, 2015
1 parent e85ccc6 commit a2f1908
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,25 @@ public void downloaded(final StreamProvider provider) throws Exception {
Path input = provider.getFile().toPath();
String name = filename != null ? filename : input.getFileName().toString();
if (provider.getUrl().startsWith("mvn:")) {
Path libOutput = homeDirectory.resolve(path).resolve(name);
Files.copy(input, libOutput, StandardCopyOption.REPLACE_EXISTING);
/*
* Do not use symbolic links for now, and do not put the jar
* in the system folder
*
String mvnPath = Parser.pathFromMaven(provider.getUrl());
Path sysOutput = systemDirectory.resolve(mvnPath);
Files.createDirectories(sysOutput.getParent());
Files.copy(input, sysOutput, StandardCopyOption.REPLACE_EXISTING);
Path libOutput = homeDirectory.resolve(path).resolve(name);
if (Files.notExists(libOutput, LinkOption.NOFOLLOW_LINKS)) {
Files.createSymbolicLink(libOutput, libOutput.getParent().relativize(sysOutput));
try {
Files.createSymbolicLink(libOutput, libOutput.getParent().relativize(sysOutput));
} catch (FileSystemException e) {
Files.copy(input, libOutput, StandardCopyOption.REPLACE_EXISTING);
}
}
*/
} else {
Path output = homeDirectory.resolve(path).resolve(name);
Files.copy(input, output, StandardCopyOption.REPLACE_EXISTING);
Expand Down

0 comments on commit a2f1908

Please sign in to comment.