You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2015/10/07 21:23:04 UTC

karaf git commit: [KARAF-3893] Embed boot libraries in system repository to allow offline usage

Repository: karaf
Updated Branches:
  refs/heads/master 42852af3d -> 3fc54bc71


[KARAF-3893] Embed boot libraries in system repository to allow offline usage


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/3fc54bc7
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/3fc54bc7
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/3fc54bc7

Branch: refs/heads/master
Commit: 3fc54bc71c4745d83b32463ec8fbbe9c8377fb26
Parents: 42852af
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Wed Oct 7 21:22:19 2015 +0200
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Wed Oct 7 21:22:19 2015 +0200

----------------------------------------------------------------------
 .../apache/karaf/profile/assembly/Builder.java  | 33 +++++++++++---------
 1 file changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/3fc54bc7/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
----------------------------------------------------------------------
diff --git a/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java b/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
index 4a4def2..1728261 100644
--- a/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
+++ b/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
@@ -632,23 +632,26 @@ public class Builder {
                         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)) {
-                                try {
-                                    Files.createSymbolicLink(libOutput, libOutput.getParent().relativize(sysOutput));
-                                } catch (FileSystemException e) {
-                                    Files.copy(input, libOutput, StandardCopyOption.REPLACE_EXISTING);
+                            // copy boot library in system repository
+                            if (type.equals(Library.TYPE_BOOT)) {
+                                String mvnPath = Parser.pathFromMaven(provider.getUrl());
+                                Path sysOutput = systemDirectory.resolve(mvnPath);
+                                Files.createDirectories(sysOutput.getParent());
+                                Files.copy(input, sysOutput, StandardCopyOption.REPLACE_EXISTING);
+                                libOutput = homeDirectory.resolve(path).resolve(name);
+                                // copy the file
+                                Files.copy(input, libOutput, StandardCopyOption.REPLACE_EXISTING);
+                                /* a symlink could be used instead
+
+                                if (Files.notExists(libOutput, LinkOption.NOFOLLOW_LINKS)) {
+                                    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);