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/08/11 17:03:19 UTC
svn commit: r1156641 - in /karaf/sandbox/jbonofre/cave/trunk: ./ assembly/
assembly/src/ assembly/src/main/ assembly/src/main/descriptors/
assembly/src/main/resources/ server/ server/backend/filesystem/
server/backend/filesystem/src/main/resources/ ser...
Author: jbonofre
Date: Thu Aug 11 15:03:18 2011
New Revision: 1156641
URL: http://svn.apache.org/viewvc?rev=1156641&view=rev
Log:
Add Karaf Cave command.
Add Karaf Cave features descriptor and src distribution.
Added:
karaf/sandbox/jbonofre/cave/trunk/assembly/
karaf/sandbox/jbonofre/cave/trunk/assembly/pom.xml
karaf/sandbox/jbonofre/cave/trunk/assembly/src/
karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/
karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/
karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/unix-src.xml
karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/windows-src.xml
karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/resources/
karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/resources/features.xml
karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/
karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/OSGI-INF/
karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/OSGI-INF/blueprint/
karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/OSGI-INF/blueprint/cave-filesystem-backend.xml
karaf/sandbox/jbonofre/cave/trunk/server/command/
karaf/sandbox/jbonofre/cave/trunk/server/command/pom.xml
- copied, changed from r1156558, karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml
karaf/sandbox/jbonofre/cave/trunk/server/command/src/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CaveRepositoryCommandSupport.java
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CreateRepositoryCommand.java
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/RegisterRepositoryCommand.java
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/ScanRepositoryCommand.java
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/UploadArtifactCommand.java
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/completers/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/completers/RepositoryCompleter.java
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/OSGI-INF/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/OSGI-INF/blueprint/
karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml
Modified:
karaf/sandbox/jbonofre/cave/trunk/pom.xml
karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml
karaf/sandbox/jbonofre/cave/trunk/server/pom.xml
Added: karaf/sandbox/jbonofre/cave/trunk/assembly/pom.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/assembly/pom.xml?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/assembly/pom.xml (added)
+++ karaf/sandbox/jbonofre/cave/trunk/assembly/pom.xml Thu Aug 11 15:03:18 2011
@@ -0,0 +1,129 @@
+<?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>cave</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.karaf.cave</groupId>
+ <artifactId>apache-karaf-cave</artifactId>
+ <name>Apache Karaf :: Cave :: Assembly</name>
+ <packaging>pom</packaging>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <useDefaultDelimiters>false</useDefaultDelimiters>
+ <delimiters>
+ <delimiter>${*}</delimiter>
+ </delimiters>
+ </configuration>
+ <executions>
+ <execution>
+ <id>filter</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>attach-artifact</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/classes/features.xml</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>unix-src</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/descriptors/unix-src.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ </execution>
+ <execution>
+ <id>windows-src</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/descriptors/windows-src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added: karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/unix-src.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/unix-src.xml?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/unix-src.xml (added)
+++ karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/unix-src.xml Thu Aug 11 15:03:18 2011
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed 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.
+-->
+<assembly>
+
+ <id>src</id>
+
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+
+ <fileSets>
+
+ <!-- Binary files -->
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*.jpeg</include>
+ <include>**/*.jpg</include>
+ <include>**/*.gif</include>
+ <include>**/*.png</include>
+ <include>**/*.jar</include>
+ <include>**/*.keystore</include>
+ <include>**/*.cert</include>
+ </includes>
+ <excludes>
+ <exclude>**/eclipse-classes/**</exclude>
+ <exclude>**/target/**</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- Text files -->
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.jpeg</exclude>
+ <exclude>**/*.jpg</exclude>
+ <exclude>**/*.gif</exclude>
+ <exclude>**/*.png</exclude>
+ <exclude>**/*.jar</exclude>
+ <exclude>**/*.keystore</exclude>
+ <exclude>**/*.cert</exclude>
+ <exclude>**/target/**</exclude>
+ <exclude>**/build/**</exclude>
+ <exclude>**/eclipse-classes/**</exclude>
+ <exclude>**/.*</exclude>
+ <exclude>**/.*/**</exclude>
+
+ <exclude>**/surefire*</exclude>
+ <exclude>**/svn-commit*</exclude>
+
+ <exclude>**/*.iml</exclude>
+ <exclude>**/*.iws</exclude>
+ <exclude>**/*.ipr</exclude>
+ </excludes>
+ <lineEnding>unix</lineEnding>
+ </fileSet>
+
+ </fileSets>
+
+</assembly>
\ No newline at end of file
Added: karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/windows-src.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/windows-src.xml?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/windows-src.xml (added)
+++ karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/descriptors/windows-src.xml Thu Aug 11 15:03:18 2011
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed 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.
+-->
+<assembly>
+
+ <id>src</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+
+ <!-- Binary files -->
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*.jpeg</include>
+ <include>**/*.jpg</include>
+ <include>**/*.gif</include>
+ <include>**/*.png</include>
+ <include>**/*.jar</include>
+ <include>**/*.keystore</include>
+ <include>**/*.cert</include>
+ </includes>
+ <excludes>
+ <exclude>**/eclipse-classes/**</exclude>
+ <exclude>**/target/**</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- Text files -->
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.jpeg</exclude>
+ <exclude>**/*.jpg</exclude>
+ <exclude>**/*.gif</exclude>
+ <exclude>**/*.png</exclude>
+ <exclude>**/*.jar</exclude>
+ <exclude>**/*.keystore</exclude>
+ <exclude>**/*.cert</exclude>
+ <exclude>**/target/**</exclude>
+ <exclude>**/build/**</exclude>
+ <exclude>**/eclipse-classes/**</exclude>
+ <exclude>**/.*</exclude>
+ <exclude>**/.*/**</exclude>
+
+ <exclude>**/surefire*</exclude>
+ <exclude>**/svn-commit*</exclude>
+
+ <exclude>**/*.iml</exclude>
+ <exclude>**/*.iws</exclude>
+ <exclude>**/*.ipr</exclude>
+ </excludes>
+ <lineEnding>dos</lineEnding>
+ </fileSet>
+
+ </fileSets>
+
+</assembly>
\ No newline at end of file
Added: karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/resources/features.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/resources/features.xml?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/resources/features.xml (added)
+++ karaf/sandbox/jbonofre/cave/trunk/assembly/src/main/resources/features.xml Thu Aug 11 15:03:18 2011
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+-->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">
+
+ <feature name="karaf-cave-server-filesystem-backend" version="${project.version}">
+ <feature>obr</feature>
+ <bundle>mvn:org.apache.karaf.cave.server.backend/org.apache.karaf.cave.server.backend.api/${project.version}</bundle>
+ <bundle>mvn:org.apache.karaf.cave.server.backend/org.apache.karaf.cave.server.backend.filesystem/${project.version}</bundle>
+ </feature>
+
+ <feature name="karaf-cave-server" version="${project.version}">
+ <bundle>mvn:org.apache.karaf.cave.server/org.apache.karaf.cave.server.command/${project.version}</bundle>
+ </feature>
+
+</features>
\ No newline at end of file
Modified: karaf/sandbox/jbonofre/cave/trunk/pom.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/pom.xml?rev=1156641&r1=1156640&r2=1156641&view=diff
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/pom.xml (original)
+++ karaf/sandbox/jbonofre/cave/trunk/pom.xml Thu Aug 11 15:03:18 2011
@@ -35,10 +35,12 @@
<properties>
<felix.bundlerepository.version>1.6.6</felix.bundlerepository.version>
+ <karaf.version>2.2.2</karaf.version>
</properties>
<modules>
<module>server</module>
+ <module>assembly</module>
</modules>
<!-- TODO add scm section when moving to Karaf svn -->
@@ -46,6 +48,11 @@
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>org.apache.karaf.shell</groupId>
+ <artifactId>org.apache.karaf.shell.console</artifactId>
+ <version>${karaf.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.bundlerepository</artifactId>
<version>${felix.bundlerepository.version}</version>
Modified: karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml?rev=1156641&r1=1156640&r2=1156641&view=diff
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml (original)
+++ karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml Thu Aug 11 15:03:18 2011
@@ -56,10 +56,10 @@
org.slf4j*;resolution:=optional,
org.apache.felix.bundlerepository*;version="[2,3)",
org.osgi.framework,
+ org.osgi.service.blueprint,
org.osgi.service.log,
org.osgi.service.url,
!org.apache.felix.shell,
- !org.apache.felix.bundlerepository.impl.wrapper,
!org.osgi.service.obr,
!javax.xml.stream,
</Import-Package>
Added: karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/OSGI-INF/blueprint/cave-filesystem-backend.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/OSGI-INF/blueprint/cave-filesystem-backend.xml?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/OSGI-INF/blueprint/cave-filesystem-backend.xml (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/src/main/resources/OSGI-INF/blueprint/cave-filesystem-backend.xml Thu Aug 11 15:03:18 2011
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
+ default-activation="lazy">
+
+ <bean id="caveRepositoryService" class="org.apache.karaf.cave.server.backend.impl.CaveRepositoryServiceImpl">
+ <property name="storageLocation" value="${karaf.cave.repositories}"/>
+ </bean>
+
+ <service ref="caveRepositoryService" interface="org.apache.karaf.cave.server.backend.api.CaveRepositoryService"/>
+
+ <!-- allow the use of system properties -->
+ <ext:property-placeholder/>
+
+</blueprint>
\ No newline at end of file
Copied: karaf/sandbox/jbonofre/cave/trunk/server/command/pom.xml (from r1156558, karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml)
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/pom.xml?p2=karaf/sandbox/jbonofre/cave/trunk/server/command/pom.xml&p1=karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml&r1=1156558&r2=1156641&rev=1156641&view=diff
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/backend/filesystem/pom.xml (original)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/pom.xml Thu Aug 11 15:03:18 2011
@@ -22,27 +22,27 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.apache.karaf.cave.server</groupId>
- <artifactId>org.apache.karaf.cave.server.backend</artifactId>
+ <groupId>org.apache.karaf.cave</groupId>
+ <artifactId>org.apache.karaf.cave.server</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>org.apache.karaf.cave.server.backend</groupId>
- <artifactId>org.apache.karaf.cave.server.backend.filesystem</artifactId>
- <name>Apache Karaf :: Cave :: Server :: Backend :: Filesystem</name>
+ <groupId>org.apache.karaf.cave.server</groupId>
+ <artifactId>org.apache.karaf.cave.server.command</artifactId>
+ <name>Apache Karaf :: Cave :: Server :: Command</name>
<packaging>bundle</packaging>
<dependencies>
<dependency>
+ <groupId>org.apache.karaf.shell</groupId>
+ <artifactId>org.apache.karaf.shell.console</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.karaf.cave.server.backend</groupId>
<artifactId>org.apache.karaf.cave.server.backend.api</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.bundlerepository</artifactId>
- </dependency>
</dependencies>
<build>
@@ -50,26 +50,15 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <configuration> <instructions>
+ <configuration>
+ <instructions>
<Import-Package>
+ org.apache.felix.service.command,
+ org.apache.felix.gogo.commands,
+ org.apache.karaf.shell.console,
org.apache.karaf.cave.server.backend.api;version="${project.version}",
- org.slf4j*;resolution:=optional,
- org.apache.felix.bundlerepository*;version="[2,3)",
- org.osgi.framework,
- org.osgi.service.log,
- org.osgi.service.url,
- !org.apache.felix.shell,
- !org.apache.felix.bundlerepository.impl.wrapper,
- !org.osgi.service.obr,
- !javax.xml.stream,
+ *
</Import-Package>
- <Private-Package>
- org.kxml2.io,
- org.xmlpull.v1,
- org.apache.felix.utils*,
- org.apache.felix.bundlerepository.impl,
- org.apache.karaf.cave.server.backend.impl
- </Private-Package>
</instructions>
</configuration>
</plugin>
Added: karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CaveRepositoryCommandSupport.java
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CaveRepositoryCommandSupport.java?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CaveRepositoryCommandSupport.java (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CaveRepositoryCommandSupport.java Thu Aug 11 15:03:18 2011
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.cave.server.command;
+
+import org.apache.aries.blueprint.di.Repository;
+import org.apache.karaf.cave.server.backend.api.CaveRepository;
+import org.apache.karaf.cave.server.backend.api.CaveRepositoryService;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+
+/**
+ * Abstract command describing the default behavior of Karaf Cave commands.
+ */
+public abstract class CaveRepositoryCommandSupport extends OsgiCommandSupport {
+
+ private CaveRepositoryService caveRepositoryService;
+
+ public CaveRepositoryService getCaveRepositoryService() {
+ return this.caveRepositoryService;
+ }
+
+ public void setCaveRepositoryService(CaveRepositoryService caveRepositoryService) {
+ this.caveRepositoryService = caveRepositoryService;
+ }
+
+ protected CaveRepository getExistingRepository(String name) {
+ CaveRepository caveRepository = caveRepositoryService.getRepository(name);
+ if (caveRepository == null) {
+ throw new IllegalArgumentException("Cave repository " + name + " does not exist");
+ }
+ return caveRepository;
+ }
+
+}
Added: karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CreateRepositoryCommand.java
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CreateRepositoryCommand.java?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CreateRepositoryCommand.java (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/CreateRepositoryCommand.java Thu Aug 11 15:03:18 2011
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.cave.server.command;
+
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.karaf.cave.server.backend.api.CaveRepository;
+
+/**
+ * Command to create a Karaf Cave repository.
+ */
+@Command(scope = "cave", name = "create-repository", description = "Creates a new Karaf Cave repository")
+public class CreateRepositoryCommand extends CaveRepositoryCommandSupport {
+
+ @Option(name = "-l", aliases = {"--location"}, description = "Location of the new Cave Repository on the file system", required = false, multiValued = false)
+ String location;
+
+ @Option(name = "-s", aliases = {"--scan"}, description = "If the Cave Repository should be scan now", required = false, multiValued = false)
+ boolean scan;
+
+ @Option(name = "-r", aliases = {"--register"}, description = "If the Cave Repository should be register in Karaf OBR", required = false, multiValued = false)
+ boolean register;
+
+ @Argument(index = 0, name = "name", description = "The name of the Cave Repository", required = true, multiValued = false)
+ String name = null;
+
+ protected Object doExecute() throws Exception {
+ if (location != null) {
+ getCaveRepositoryService().createRepository(name, location, false);
+ } else {
+ getCaveRepositoryService().createRepository(name, false);
+ }
+ CaveRepository caveRepository = getExistingRepository(name);
+ if (scan) {
+ caveRepository.scan();
+ }
+ if (register) {
+ caveRepository.register();
+ }
+ return null;
+ }
+
+}
Added: karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/RegisterRepositoryCommand.java
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/RegisterRepositoryCommand.java?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/RegisterRepositoryCommand.java (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/RegisterRepositoryCommand.java Thu Aug 11 15:03:18 2011
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.cave.server.command;
+
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.cave.server.backend.api.CaveRepository;
+
+/**
+ * Command to register a Karaf Cave repository into the Karaf OBR.
+ */
+@Command(scope = "cave", name = "register-repository", description = "Register a Karaf Cave repository in the Karaf OBR")
+public class RegisterRepositoryCommand extends CaveRepositoryCommandSupport {
+
+ @Argument(index = 0, name = "name", description = "Name of Karaf Cave repository to register", required = true, multiValued = false)
+ String name = null;
+
+ protected Object doExecute() throws Exception {
+ CaveRepository caveRepository = getExistingRepository(name);
+ caveRepository.register();
+ return null;
+ }
+
+}
Added: karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/ScanRepositoryCommand.java
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/ScanRepositoryCommand.java?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/ScanRepositoryCommand.java (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/ScanRepositoryCommand.java Thu Aug 11 15:03:18 2011
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.cave.server.command;
+
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.cave.server.backend.api.CaveRepository;
+
+/**
+ * Command to scan an existing repository and update the OBR metadata
+ */
+@Command(scope = "cave", name = "scan-repository", description = "Scan an existing Karaf Cave repository and update OBR metadata")
+public class ScanRepositoryCommand extends CaveRepositoryCommandSupport {
+
+ @Argument(index = 0, name = "name", description = "The name of the Karaf Cave repository", required = true, multiValued = false)
+ String name = null;
+
+ protected Object doExecute() throws Exception {
+ CaveRepository caveRepository = getExistingRepository(name);
+ caveRepository.scan();
+ return null;
+ }
+
+}
Added: karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/UploadArtifactCommand.java
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/UploadArtifactCommand.java?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/UploadArtifactCommand.java (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/UploadArtifactCommand.java Thu Aug 11 15:03:18 2011
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.cave.server.command;
+
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+import org.apache.karaf.cave.server.backend.api.CaveRepository;
+
+import java.net.URL;
+
+/**
+ * Command to upload an artifact into a Karaf Cave repository.
+ */
+@Command(scope = "cave", name = "upload-artifact", description = "Upload an artifact in a Karaf Cave repository")
+public class UploadArtifactCommand extends CaveRepositoryCommandSupport {
+
+ @Argument(index = 0, name = "repository", description = "The name of the Karaf Cave repository", required = true, multiValued = false)
+ String name = null;
+
+ @Argument(index = 1, name = "artifact", description = "The URL of the artifact to upload", required = true, multiValued = false)
+ String url = null;
+
+ public Object doExecute() throws Exception {
+ CaveRepository caveRepository = getExistingRepository(name);
+ caveRepository.upload(new URL(url));
+ return null;
+ }
+
+}
Added: karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/completers/RepositoryCompleter.java
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/completers/RepositoryCompleter.java?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/completers/RepositoryCompleter.java (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/java/org/apache/karaf/cave/server/command/completers/RepositoryCompleter.java Thu Aug 11 15:03:18 2011
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.cave.server.command.completers;
+
+import jline.console.completer.Completer;
+import org.apache.karaf.cave.server.backend.api.CaveRepository;
+import org.apache.karaf.cave.server.backend.api.CaveRepositoryService;
+import org.apache.karaf.shell.console.completer.StringsCompleter;
+
+import java.util.List;
+
+/**
+ * Completer of the Karaf Cave repositories.
+ */
+public class RepositoryCompleter implements Completer {
+
+ private CaveRepositoryService caveRepositoryService;
+
+ public void setCaveRepositoryService(CaveRepositoryService caveRepositoryService) {
+ this.caveRepositoryService = caveRepositoryService;
+ }
+
+ public CaveRepositoryService getCaveRepositoryService() {
+ return this.caveRepositoryService;
+ }
+
+ public int complete(String buffer, int cursor, List candidates) {
+ StringsCompleter delegate = new StringsCompleter();
+ for (CaveRepository caveRepository : caveRepositoryService.getRepositories()) {
+ delegate.getStrings().add(caveRepository.getName());
+ }
+ return delegate.complete(buffer, cursor, candidates);
+ }
+}
Added: karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml?rev=1156641&view=auto
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml (added)
+++ karaf/sandbox/jbonofre/cave/trunk/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml Thu Aug 11 15:03:18 2011
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
+
+ <reference id="caveRepositoryService" interface="org.apache.karaf.cave.server.backend.api.CaveRepositoryService"/>
+
+ <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
+ <command name="cave/create-repository">
+ <action class="org.apache.karaf.cave.server.command.CreateRepositoryCommand">
+ <property name="caveRepositoryService" ref="caveRepositoryService"/>
+ </action>
+ </command>
+ <command name="cave/scan-repository">
+ <action class="org.apache.karaf.cave.server.command.ScanRepositoryCommand">
+ <property name="caveRepositoryService" ref="caveRepositoryService"/>
+ </action>
+ <completers>
+ <ref component-id="repositoryCompleter"/>
+ <null/>
+ </completers>
+ </command>
+ <command name="cave/register-repository">
+ <action class="org.apache.karaf.cave.server.command.RegisterRepositoryCommand">
+ <property name="caveRepositoryService" ref="caveRepositoryService"/>
+ </action>
+ <completers>
+ <ref component-id="repositoryCompleter"/>
+ <null/>
+ </completers>
+ </command>
+ <command name="cave/upload-artifact">
+ <action class="org.apache.karaf.cave.server.command.UploadArtifactCommand">
+ <property name="caveRepositoryService" ref="caveRepositoryService"/>
+ </action>
+ <completers>
+ <ref component-id="repositoryCompleter"/>
+ <null/>
+ </completers>
+ </command>
+ </command-bundle>
+
+ <bean id="repositoryCompleter" class="org.apache.karaf.cave.server.command.completers.RepositoryCompleter">
+ <property name="caveRepositoryService" ref="caveRepositoryService"/>
+ </bean>
+
+</blueprint>
\ No newline at end of file
Modified: karaf/sandbox/jbonofre/cave/trunk/server/pom.xml
URL: http://svn.apache.org/viewvc/karaf/sandbox/jbonofre/cave/trunk/server/pom.xml?rev=1156641&r1=1156640&r2=1156641&view=diff
==============================================================================
--- karaf/sandbox/jbonofre/cave/trunk/server/pom.xml (original)
+++ karaf/sandbox/jbonofre/cave/trunk/server/pom.xml Thu Aug 11 15:03:18 2011
@@ -35,6 +35,7 @@
<modules>
<module>backend</module>
+ <module>command</module>
</modules>
</project>
\ No newline at end of file