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 2011/12/27 18:32:35 UTC

svn commit: r1224954 [2/2] - in /karaf/trunk: ./ assemblies/features/standard/src/main/feature/ deployer/kar/ deployer/kar/src/main/java/org/apache/karaf/deployer/kar/ deployer/kar/src/main/resources/OSGI-INF/blueprint/ deployer/kar/src/test/java/org/a...

Added: karaf/trunk/kar/pom.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/kar/pom.xml?rev=1224954&view=auto
==============================================================================
--- karaf/trunk/kar/pom.xml (added)
+++ karaf/trunk/kar/pom.xml Tue Dec 27 17:32:33 2011
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You under the Apache License, Version 2.0
+        (the "License"); you may not use this file except in compliance with
+        the License.  You may obtain a copy of the License at
+
+            http://www.apache.org/licenses/LICENSE-2.0
+
+        Unless required by applicable law or agreed to in writing, software
+        distributed under the License is distributed on an "AS IS" BASIS,
+        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+        See the License for the specific language governing permissions and
+        limitations under the License.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.karaf</groupId>
+        <artifactId>karaf</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.karaf.kar</groupId>
+    <artifactId>kar</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache Karaf :: KAR</name>
+
+    <modules>
+        <module>core</module>
+        <module>command</module>
+        <module>management</module>
+    </modules>
+
+</project>
\ No newline at end of file

Modified: karaf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/pom.xml?rev=1224954&r1=1224953&r2=1224954&view=diff
==============================================================================
--- karaf/trunk/pom.xml (original)
+++ karaf/trunk/pom.xml Tue Dec 27 17:32:33 2011
@@ -38,6 +38,7 @@
         <module>util</module>
         <module>main</module>
         <module>features</module>
+        <module>kar</module>
         <module>region</module>
         <module>admin</module>
         <module>deployer</module>
@@ -343,6 +344,16 @@
                 <version>${project.version}</version>
             </dependency>
             <dependency>
+                <groupId>org.apache.karaf.kar</groupId>
+                <artifactId>org.apache.karaf.kar.command</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.karaf.kar</groupId>
+                <artifactId>org.apache.karaf.kar.core</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>org.apache.karaf.management</groupId>
                 <artifactId>org.apache.karaf.management.server</artifactId>
                 <version>${project.version}</version>

Modified: karaf/trunk/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java?rev=1224954&r1=1224953&r2=1224954&view=diff
==============================================================================
--- karaf/trunk/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java (original)
+++ karaf/trunk/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java Tue Dec 27 17:32:33 2011
@@ -47,6 +47,7 @@ import org.apache.karaf.features.interna
 import org.apache.karaf.features.internal.model.Features;
 import org.apache.karaf.features.internal.model.Feature;
 import org.apache.karaf.features.internal.model.JaxbUtil;
+import org.apache.karaf.kar.internal.KarServiceImpl;
 import org.apache.karaf.tooling.utils.MojoSupport;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
@@ -191,21 +192,26 @@ public class InstallKarsMojo extends Moj
                 startupPropertiesFile.getParentFile().mkdirs();
             }
         }
-        KarArtifactInstaller installer = new KarArtifactInstaller();
-        installer.setBasePath(workDirectory);
+        KarServiceImpl karService = new KarServiceImpl();
         FeaturesService featuresService = new OfflineFeaturesService();
-        installer.setFeaturesService(featuresService);
-        installer.init();
+        karService.setFeaturesService(featuresService);
+        karService.setBase(workDirectory);
+        try {
+            karService.init();
+        } catch (Exception e) {
+            throw new MojoExecutionException("Can't init the KAR service", e);
+        }
+        
         Collection<Artifact> dependencies = project.getDependencyArtifacts();
         StringBuilder buf = new StringBuilder();
         byte[] buffer = new byte[4096];
         for (Artifact artifact: dependencies) {
             dontAddToStartup = "runtime".equals(artifact.getScope());
-            installer.setLocalRepoPath(system.getPath());
+            karService.setLocalRepo(system.getPath());
             if ("kar".equals(artifact.getType()) && acceptScope(artifact)) {
                 File file = artifact.getFile();
                 try {
-                    installer.install(file);
+                    karService.install(file.toURI());
                 } catch (Exception e) {
                     buf.append("Could not install kar: ").append(artifact.toString()).append("\n");
                     buf.append(e.getMessage()).append("\n\n");