You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/java-application-development/kura-addon-archetype.md
+28-16Lines changed: 28 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,23 @@ mvn archetype:generate \
29
29
-DarchetypeVersion="<kura-version>"
30
30
```
31
31
32
-
The command will start the generation of the archetype in interactive mode. Maven will ask for a few parameters on the command line:
32
+
The command will start the generation of the archetype in interactive mode.
33
33
34
-
-**groupId** : the Maven group id of the generated pom files, usually `org.eclipse.kura`
35
-
-**artifactId**: the Maven artifact id of the generated parent pom file and the name of the generated top level project folder, usually something like `org.eclipse.kura.myartifact`
36
-
-**package**: the Java package to be used for the main bundle, usually something like `org.eclipse.kura.myartifact`
**It is not allowed to generate a project with artifactId = package**.
37
49
38
50
The following optional parameters can be changed by answering `n` after the `Confirm properties configuration` prompt, which appears after editing the properties above:
39
51
@@ -49,29 +61,23 @@ The project _requires_ source control management via `git` to correctly build. T
49
61
50
62
```bash
51
63
git init
52
-
```
53
-
54
-
```bash
55
64
git add .
56
-
```
57
-
58
-
```bash
59
65
git commit -m "initial commit"
60
66
```
61
67
62
68
Once this steps are completed you can safely build the project.
63
69
64
70
## Project structure
65
71
66
-
At the end of the procedure, the archetype will generate a subfolder in the working directory containing the following subfolders:
67
-
68
-
-**bundles**: the directory where developed bundles can be placed. After the first archetype execution, this directory contains a single project, named as `artifactId.bundle`
72
+
At the end of the procedure, the generated project is organized as follows:
69
73
70
-
-**distrib**: contains a project that builds a DEB package that installs the JAR produced in `bundles` in Kura's plugins folder `/opt/eclipse/kura/plugins`. It is recommended to configure this project to customize the target package architecture and other parameters. The project code is commented with hints on the configurable options
-**target-definition**: The `.target` file contained in the project is the way to specify the project dependencies as maven artifacts, Tycho will then wrap them as bundles and make them available in the target platform. Since only released artifacts are published on Maven central, it is recommeded to perform a local Kura build to have the SNAPSHOT versions available
76
+
-**parent**: the main reactor project. It aggregates this project’s OSGi bundles, integration and unit tests, and the target platform definition. Immediately after generation, it includes a single OSGi bundle named after the `{package}` value (for example, `org.eclipse.kura.myfeature`)
77
+
-**target-definition**: contains the `.target` file that defines the target platform dependencies. Dependencies are declared as Maven artifacts; Tycho then wraps them as OSGi bundles and adds them to the target platform. Because Maven Central only hosts released artifacts, it is recommended to build Kura locally if you need *-SNAPSHOT* dependencies
78
+
-**tests**: contains OSGi integration tests executed via the `tycho-surefire-plugin`
73
79
74
-
-**tests**: contains OSGi integration tests executed by the `tycho-surefire-plugin`
80
+
-**distrib**: a packaging project that builds a Debian (`.deb`) package. The package installs the JAR produced by the bundles into Kura’s plugins directory at `/opt/eclipse/kura/plugins`. You should review and adjust this project to match your target architecture and packaging requirements; the source is annotated with comments indicating the main configuration points
As default, the `distrib` project and the projects under `parent` are not deployed (they are configured to skip the execution of the `maven-deploy-plugin`). Only the BOM POM (the root `pom.xml`) and the single OSGi bundles are meant to be deployed.
136
+
137
+
Please add the proper `maven-deploy-plugin` configuration for the bundles that need to be deployed. See the archetype's generated bundle for details.
138
+
127
139
## IDE setup
128
140
129
141
We officially support two IDEs for developing Kura Addons: **Eclipse IDE** and **Visual Studio Code**. The following sections describe how to set up the projects in these IDEs.
0 commit comments