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/19 14:07:02 UTC
svn commit: r1220729 - in /karaf/trunk/manual/src/main/webapp:
developers-guide/archetypes.conf developers-guide/index.conf manual.conf
Author: jbonofre
Date: Mon Dec 19 13:07:01 2011
New Revision: 1220729
URL: http://svn.apache.org/viewvc?rev=1220729&view=rev
Log:
[KARAF-1111] Update the Karaf documentation with archetypes description
Modified:
karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf
karaf/trunk/manual/src/main/webapp/developers-guide/index.conf
karaf/trunk/manual/src/main/webapp/manual.conf
Modified: 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=1220729&r1=1220728&r2=1220729&view=diff
==============================================================================
--- karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf (original)
+++ karaf/trunk/manual/src/main/webapp/developers-guide/archetypes.conf Mon Dec 19 13:07:01 2011
@@ -5,9 +5,9 @@ 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
+h2. Create a command (karaf-command-archetype)
-This archetype creates a maven skeleton project that you will use to developp new Karaf commands.
+This archetype creates a Maven skeleton project that you will use to develop new Karaf commands.
h3. Command line
@@ -15,11 +15,12 @@ Using the command line, we can create ou
{code}
mvn archetype:generate \
-DarchetypeGroupId=org.apache.karaf.archetypes \
- -DartifactId=karaf-deploy-command \
+ -DartifactId=karaf-command-archetype \
-DarchetypeVersion=${project.version} \
- -DgroupId=my-project-groupid \
- -DartifactId=my-commands \
- -Dversion=1.0-SNAPSHOT
+ -DgroupId=com.mycompany \
+ -DartifactId=com.mycompany.command \
+ -Dversion=1.0-SNAPSHOT \
+ -Dpackage=com.mycompany.package
{code}
h3. Additional parameters
@@ -27,13 +28,223 @@ h3. Additional parameters
During the maven creation process, additional questions will be asked on the console :
** Define value for property 'command':
-
+ The name of the command (list, add-item, ...)
** 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:karaf-command-archetype:${project.version}] found in catalog local
+[INFO] Using property: groupId = com.mycompany
+[INFO] Using property: artifactId = com.mycompany.command
+[INFO] Using property: version = 1.0-SNAPSHOT
+[INFO] Using property: package = com.mycompany.package
+Define value for property 'command': : list
+Define value for property 'description': : List sample command
+Define value for property 'scope': : my
+Confirm properties configuration:
+groupId: com.mycompany
+artifactId: com.mycompany.command
+version: 1.0-SNAPSHOT
+package: com.mycompany.package
+command: list
+description: List sample command
+scope: my
+ Y: :
+[INFO] ----------------------------------------------------------------------------
+[INFO] Using following parameters for creating project from Archetype: karaf-command-archetype:${project.version}
+[INFO] ----------------------------------------------------------------------------
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.command
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: packageInPathFormat, Value: com/mycompany/package
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: scope, Value: my
+[INFO] Parameter: description, Value: List sample command
+[INFO] Parameter: command, Value: list
+[INFO] Parameter: artifactId, Value: com.mycompany.command
+[WARNING] Don't override file /home/jbonofre/workspace/karaf/test/com.mycompany.command/pom.xml
+[INFO] project created from Archetype in dir: /home/jbonofre/workspace/karaf/test/com.mycompany.command
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 27.204s
+[INFO] Finished at: Mon Dec 19 09:38:49 CET 2011
+[INFO] Final Memory: 7M/111M
+[INFO] ------------------------------------------------------------------------
+{code}
+
+Next, you can import your project in Eclipse/IntelliJ and developp the karaf command.
+
+h2. Create an OSGi bundle (karaf-bundle-archetype)
+
+This archetype creates a Maven skeleton to create an OSGi bundle, including a bundle Activator (a special callback class for bundle start/stop).
+
+h3. Command line
+
+Using the command line, we can create our project:
+{code}
+mvn archetype:generate \
+ -DarchetypeGroupId=org.apache.karaf.archetypes \
+ -DarchetypeArtifactId=karaf-bundle-archetype \
+ -DarchetypeVersion=${project.version} \
+ -DgroupId=com.mycompany \
+ -DartifactId=com.mycompany.bundle \
+ -Dversion=1.0-SNAPSHOT \
+ -Dpackage=com.mycompany.package
+{code}
+
+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:karaf-bundle-archetype:3.0.0-SNAPSHOT] found in catalog local
+[INFO] Using property: groupId = com.mycompany
+[INFO] Using property: artifactId = com.mycompany.bundle
+[INFO] Using property: version = 1.0-SNAPSHOT
+[INFO] Using property: package = com.mycompany.package
+Confirm properties configuration:
+groupId: com.mycompany
+artifactId: com.mycompany.bundle
+version: 1.0-SNAPSHOT
+package: com.mycompany.package
+ Y: :
+[INFO] ----------------------------------------------------------------------------
+[INFO] Using following parameters for creating project from Archetype: karaf-bundle-archetype:3.0.0-SNAPSHOT
+[INFO] ----------------------------------------------------------------------------
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.bundle
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: packageInPathFormat, Value: com/mycompany/package
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.bundle
+[INFO] project created from Archetype in dir: /home/jbonofre/workspace/karaf/test/com.mycompany.bundle
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 7.895s
+[INFO] Finished at: Mon Dec 19 11:41:44 CET 2011
+[INFO] Final Memory: 8M/111M
+[INFO] ------------------------------------------------------------------------
+{code}
+
+h2. Create an OSGi blueprint bundle (karaf-blueprint-archetype)
+
+This archetype creates a Maven skeleton project to create an OSGi blueprint bundle, including a sample bean exposed as an OSGi service in the blueprint XML descriptor.
+
+h3. Command line
+
+Using the command line, we can create our project:
+{code}
+mvn archetype:generate \
+ -DarchetypeGroupId=org.apache.karaf.archetypes \
+ -DarchetypeArtifactId=karaf-blueprint-archetype \
+ -DarchetypeVersion=${project.version} \
+ -DgroupId=com.mycompany \
+ -DartifactId=com.mycompany.blueprint \
+ -Dversion=1.0-SNAPSHOT \
+ -Dpackage=com.mycompany.blueprint
+{code}
+
+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:karaf-blueprint-archetype:3.0.0-SNAPSHOT] found in catalog local
+[INFO] Using property: groupId = com.mycompany
+[INFO] Using property: artifactId = com.mycompany.blueprint
+[INFO] Using property: version = 1.0-SNAPSHOT
+[INFO] Using property: package = com.mycompany.package
+Confirm properties configuration:
+groupId: com.mycompany
+artifactId: com.mycompany.blueprint
+version: 1.0-SNAPSHOT
+package: com.mycompany.package
+ Y: :
+[INFO] ----------------------------------------------------------------------------
+[INFO] Using following parameters for creating project from Archetype: karaf-blueprint-archetype:3.0.0-SNAPSHOT
+[INFO] ----------------------------------------------------------------------------
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.blueprint
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: packageInPathFormat, Value: com/mycompany/package
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.blueprint
+[INFO] project created from Archetype in dir: /home/jbonofre/workspace/karaf/test/com.mycompany.blueprint
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 1:06:36.741s
+[INFO] Finished at: Mon Dec 19 13:04:43 CET 2011
+[INFO] Final Memory: 7M/111M
+[INFO] ------------------------------------------------------------------------
+{code}
+
+h2. Create a features XML (karaf-feature-archetype)
+
+This archetype creates a Maven skeleton project which create a features XML file, using the dependencies that you define in the POM.
+
+h3. Command line
+
+Using the command line, we can create our project:
+{code}
+mvn archetype:generate \
+ -DarchetypeGroupId=org.apache.karaf.archetypes \
+ -DarchetypeArtifactId=karaf-feature-archetype \
+ -DarchetypeVersion=${project.version} \
+ -DgroupId=my.company \
+ -DartifactId=my.company.feature \
+ -Dversion=1.0-SNAPSHOT \
+ -Dpackage=my.company.package
+{code}
+
h3. Result of maven command execution
{code}
@@ -49,23 +260,101 @@ h3. Result of maven command execution
[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
+[INFO] Archetype repository missing. Using the one from [org.apache.karaf.archetypes:karaf-feature-archetype:3.0.0-SNAPSHOT] found in catalog local
+[INFO] Using property: groupId = com.mycompany
+[INFO] Using property: artifactId = com.mycompany.feature
+[INFO] Using property: version = 1.0-SNAPSHOT
+[INFO] Using property: package = com.mycompany.package
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
+groupId: com.mycompany
+artifactId: com.mycompany.feature
+version: 1.0-SNAPSHOT
+package: com.mycompany.package
+ Y: :
+[INFO] ----------------------------------------------------------------------------
+[INFO] Using following parameters for creating project from Archetype: karaf-feature-archetype:3.0.0-SNAPSHOT
+[INFO] ----------------------------------------------------------------------------
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.feature
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: packageInPathFormat, Value: com/mycompany/package
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.feature
+[INFO] project created from Archetype in dir: /home/jbonofre/workspace/karaf/test/com.mycompany.feature
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 7.262s
+[INFO] Finished at: Mon Dec 19 13:20:00 CET 2011
+[INFO] Final Memory: 7M/111M
+[INFO] ------------------------------------------------------------------------
{code}
-Next, you can import your project in Eclipse/IntelliJ and developp the karaf command.
\ No newline at end of file
+h2. Create a KAR file (karaf-kar-archetype)
+
+This archetype creates a Maven skeleton project including a features XML sample, used to generate a KAR file.
+
+h3. Command line
+
+Using the command line, we can create our project:
+{code}
+mvn archetype:generate \
+ -DarchetypeGroupId=org.apache.karaf.archetypes \
+ -DarchetypeArtifactId=karaf-kar-archetype \
+ -DarchetypeVersion=${project.version} \
+ -DgroupId=com.mycompany \
+ -DartifactId=com.mycompany.kar \
+ -Dversion=1.0-SNAPSHOT \
+ -Dpackage=com.mycompany.package
+{code}
+
+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:karaf-kar-archetype:3.0.0-SNAPSHOT] found in catalog local
+[INFO] Using property: groupId = com.mycompany
+[INFO] Using property: artifactId = com.mycompany.kar
+[INFO] Using property: version = 1.0-SNAPSHOT
+[INFO] Using property: package = com.mycompany.package
+Confirm properties configuration:
+groupId: com.mycompany
+artifactId: com.mycompany.kar
+version: 1.0-SNAPSHOT
+package: com.mycompany.package
+ Y: :
+[INFO] ----------------------------------------------------------------------------
+[INFO] Using following parameters for creating project from Archetype: karaf-kar-archetype:3.0.0-SNAPSHOT
+[INFO] ----------------------------------------------------------------------------
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.kar
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: packageInPathFormat, Value: com/mycompany/package
+[INFO] Parameter: package, Value: com.mycompany.package
+[INFO] Parameter: version, Value: 1.0-SNAPSHOT
+[INFO] Parameter: groupId, Value: com.mycompany
+[INFO] Parameter: artifactId, Value: com.mycompany.kar
+[INFO] project created from Archetype in dir: /home/jbonofre/workspace/karaf/test/com.mycompany.kar
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 7.465s
+[INFO] Finished at: Mon Dec 19 13:30:15 CET 2011
+[INFO] Final Memory: 8M/157M
+[INFO] ------------------------------------------------------------------------
+{code}
Modified: karaf/trunk/manual/src/main/webapp/developers-guide/index.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/developers-guide/index.conf?rev=1220729&r1=1220728&r2=1220729&view=diff
==============================================================================
--- karaf/trunk/manual/src/main/webapp/developers-guide/index.conf (original)
+++ karaf/trunk/manual/src/main/webapp/developers-guide/index.conf Mon Dec 19 13:07:01 2011
@@ -2,6 +2,7 @@ h1. Developers Guide
* [Connect to the Console|connect-console]
* [Branding the Console|branding-console]
+* [Maven Archetypes|archetypes]
* [Extending the Console|extending-console]
* [Custom Distribution|custom-distribution]
* [Security Framework|security-framework]
Modified: karaf/trunk/manual/src/main/webapp/manual.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/manual.conf?rev=1220729&r1=1220728&r2=1220729&view=diff
==============================================================================
--- karaf/trunk/manual/src/main/webapp/manual.conf (original)
+++ karaf/trunk/manual/src/main/webapp/manual.conf Mon Dec 19 13:07:01 2011
@@ -62,6 +62,7 @@ h1. Developers Guide
{include:developers-guide/creating-bundles.conf}
{include:developers-guide/debugging.conf}
{include:developers-guide/developer-commands.conf}
+{include:developers-guide/archetypes.conf}
{include:developers-guide/extending-console.conf}
{include:developers-guide/branding-console.conf}
{include:developers-guide/karaf-maven-plugin.conf}