You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by cm...@apache.org on 2011/12/08 11:47:10 UTC

svn commit: r1211817 - /karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf

Author: cmoulliard
Date: Thu Dec  8 10:47:09 2011
New Revision: 1211817

URL: http://svn.apache.org/viewvc?rev=1211817&view=rev
Log:
karaf-1100: Add an archetypes page in the manual of Karaf

Added:
    karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf

Added: karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf?rev=1211817&view=auto
==============================================================================
--- karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf (added)
+++ karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf Thu Dec  8 10:47:09 2011
@@ -0,0 +1,71 @@
+
+
+h1. Archetypes
+
+Karaf provides archetypes to easily create commands, manage [features or repository and create a kar archive.
+This section describes each of them and explain How to use it.
+
+h2. Create a command
+
+This archetype creates a maven skeleton project that you will use to developp new Karaf commands.
+
+h3. Command line
+
+Using the command line, we can create our project:
+{code}
+mvn archetype:generate \
+  -DarchetypeGroupId=org.apache.karaf.archetypes \
+  -DartifactId=karaf-deploy-command \
+  -DarchetypeVersion=${project.version} \
+  -DgroupId=my-project-groupid \
+  -DartifactId=my-commands \
+  -Dversion=1.0-SNAPSHOT
+{code}
+
+h3. Additional parameters
+
+During the maven creation process, additional questions will be asked on the console :
+
+** Define value for property 'command':
+
+** Define value for property 'description':
+   Provide a description of the command that you want to create. This description will be displayed in the Karaf console when
+   the parameter --help is used
+** Define value for property 'scope':
+   This value represents the family name to which the command belongs (features, osgi, admin, jaas, ...)
+
+h3. Result of maven command execution
+
+{code}
+[INFO] Scanning for projects...
+[INFO]
+[INFO] ------------------------------------------------------------------------
+[INFO] Building Maven Stub Project (No POM) 1
+[INFO] ------------------------------------------------------------------------
+[INFO]
+[INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>>
+[INFO]
+[INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<<
+[INFO]
+[INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom ---
+[INFO] Generating project in Interactive mode
+[INFO] Archetype repository missing. Using the one from [org.apache.karaf.archetypes:archetypes-command:2.2.4] found in catalog remote
+[INFO] Using property: groupId = org.apache.openejb
+[INFO] Using property: artifactId = karaf-deploy-command2
+[INFO] Using property: version = 4.0.0-beta-2-SNAPSHOT
+[INFO] Using property: package = org.apache.openejb
+Define value for property 'command': : deploy
+Define value for property 'description': : deploy
+Define value for property 'scope': : deploy
+Confirm properties configuration:
+groupId: org.apache.openejb
+artifactId: karaf-deploy-command2
+version: 4.0.0-beta-2-SNAPSHOT
+package: org.apache.openejb
+command: deploy
+description: deploy
+scope: deploy
+ Y: : Y
+{code}
+
+Next, you can import your project in Eclipse/IntelliJ and developp the karaf command.
\ No newline at end of file