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: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,15 @@
3
3
4
4
[](https://github.com/eclipse-tycho/tycho/actions/workflows/maven.yml)[](https://github.com/eclipse-tycho/tycho/actions/workflows/check.yml)[](https://github.com/eclipse-tycho/tycho/actions/workflows/licensecheck.yml)
# Tycho Workspace template fragment for bndtools for pomless Maven build
2
+
3
+
This is a [bndtools template fragment](https://bnd.bndtools.org/chapters/620-template-fragments.html) which you can use in a new or existing bndtools workspace,
4
+
to add a Maven build based on Eclipse Tycho for your bnd workspace.
5
+
6
+
It creates a `.mvn` folder in your bnd workspace root, contain an `extensions.xml` and a `maven.config`.
7
+
8
+
See documentation for the [Tycho BND Plugin](https://tycho.eclipseprojects.io/doc/main/BndBuild.html) for more information.
9
+
10
+
## Building your workspace
11
+
12
+
```
13
+
cd mybndworkspace
14
+
mvn clean install
15
+
```
16
+
17
+
This is all you need to build your bnd workspace with Maven / Tycho.
18
+
19
+
It will automatically consider all `bnd.bnd` files.
20
+
21
+
22
+
## Optional configurator pom.xml
23
+
24
+
While the default build is pomless, you can create a parent `pom.xml` in your `cnf` folder.
This is useful if you want to add other maven plugins to your build, e.g., for code analysis or reporting.
41
+
42
+
## Create executable jar based on .bndrun files
43
+
44
+
Tycho can also create an executable `.jar` file of your application based on the `.bndrun` file containing `-runbundles`, which you can then deploy and start.
45
+
46
+
Just add the following line to your `.mvn/maven.config` file or pass it on the maven commandline:
47
+
48
+
```
49
+
-Dbndrun.exports=mydemo.app
50
+
```
51
+
52
+
See [Create executable jar](https://tycho.eclipseprojects.io/doc/main/BndBuild.html#Create_executable_jar) for details.
Copy file name to clipboardExpand all lines: src/site/markdown/BndBuild.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ A BND Workspace layout build layout usually has the following structure:
13
13
-`bnd.bnd` - project configuration file
14
14
-`bundle2` - Another bundle project
15
15
-`bnd.bnd` - project configuration file
16
+
-`myapp.bndrun` - a .bndrun file which can be used to export an executable .jar as part of the build
16
17
-`...`
17
18
18
19
Any folder that does not match the layout is ignored.
@@ -51,6 +52,55 @@ If you want to further configure the build can be done in these ways:
51
52
2. You can define properties per project properties in the `bnd.bnd` file `pom.model.property.<some property>: true`, see [the wiki](https://github.com/eclipse-tycho/tycho/wiki/Tycho-Pomless#overwrite-group-and-artifact-ids) for more details.
52
53
3. You can place a `pom.xml` in your `cnf` folder this will then be used as a parent for the aggregator, here you can add additional mojos, profiles and so on. If you want to enable certain things only for some of the projects you can use properties as described in (2) to skip the execution of mojos not relevant for other projects.
53
54
55
+
#### Create executable jar
56
+
57
+
Tycho can also create an executable `.jar` file of your application based on a `.bndrun` file containing `-runbundles`, which you can then deploy and start.
58
+
59
+
Just add the following line to your `.mvn/maven.config` file or pass it on the maven commandline:
60
+
61
+
```
62
+
-Dbndrun.exports=mydemo.app
63
+
```
64
+
65
+
This automatically searches all your bundles for a file named `mydemo.app.bndrun`.
66
+
67
+
If you have a bundle `myappbundle` which contains `mydemo.app.bndrun`, then the build would create an executable jar at the following location:
[INFO] Exported to .../myappbundle/target/executable/tycho.demo.app.jar
77
+
```
78
+
79
+
54
80
## Mixed Builds
55
81
56
82
You can even combine a BND Workspace and PDE bundles in a build, see [demo](https://github.com/eclipse-tycho/tycho/tree/master/demo/bnd-pde-workspace).
83
+
84
+
85
+
## Troubleshooting
86
+
87
+
Note: All properties in `.mvn/maven.config` can also be supplied via command line, for example to use a different tycho version use the following command line argument:
This uses the snapshot build which is useful if you build tycho yourself on your local machine and want to test that build.
92
+
93
+
94
+
### polyglot.dump.pom
95
+
96
+
E.g., `-Dpolyglot.dump.pom=pom-gen.xml` specifies that the generated pom.xml files which tycho polyglot creates is called `pom-gen.xml`.
97
+
This might be needed if you have name clashes with existing files in your build.
98
+
99
+
100
+
### tycho.pomless.aggregator.names
101
+
102
+
The command line argument `-Dtycho.pomless.aggregator.names=_dummydisabled_` is for handling a rare edge case:
103
+
In case you have your bnd workspace in a subfolder named `bundles`, `plugins`, `tests`,`features`, `sites`,`products`, or `releng` then tycho can have problems.
104
+
The reason is that those names are kind of 'magic' names reserved for special usecases.
105
+
`-Dtycho.pomless.aggregator.names=_dummydisabled_` is a workaround to instruct Tycho to ignore those names. You can choose any word like `_dummydisabled_`, but just make sure you do not have a folder with that name.
0 commit comments