Skip to content

Commit

Permalink
move more docu to BndBuild.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrueger committed Feb 3, 2025
1 parent adab015 commit 0f43320
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
21 changes: 4 additions & 17 deletions setup/bnd-templates/pomless/.mvn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This should be all you need to build your bnd workspace with Maven / Tycho.
It will automatically consider all `bnd.bnd` files.


## Optional parent pom.xml
## Optional configurator pom.xml

While the default build is pomless, you can create a parent `pom.xml` in you `cnf` folder.
It can be as simple as that:
Expand All @@ -39,28 +39,15 @@ It can be as simple as that:

This is useful if you want to add other maven plugins to your build e.g. for code analysis or reporting.

## Creating executable jar based on .bndrun files
## Create executable jar based on .bndrun files

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.

Just add the following line to you `.mvn/maven.config` file:
Just add the following line to your `.mvn/maven.config` file or pass it on the maven commandline:

```
-Dbndrun.exports=mydemo.app
```

This automatically searches all your bundles for a file named `mydemo.app.bndrun`.

If you have a bundle `myappbundle` which contains `mydemo.app.bndrun`, then the build would create an executable jar at:

`/myappbundle/target/executable/mydemo.app.bndrun.jar`

Your build output looks like this:

```
[INFO] --- tycho-bnd:4.0.11:run (build) @ myappbundle ---
[INFO] Exporting mydemo.app.bndrun ...
[INFO] Exported to .../myappbundle/target/executable/tycho.demo.app.jar
```

See [Create executable jar](https://tycho.eclipseprojects.io/doc/main/BndBuild.html#Create_executable_jar) for details.

25 changes: 25 additions & 0 deletions src/site/markdown/BndBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ If you want to further configure the build can be done in these ways:
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.
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.

#### Create executable jar

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.

Just add the following line to your `.mvn/maven.config` file or pass it on the maven commandline:

```
-Dbndrun.exports=mydemo.app
```

This automatically searches all your bundles for a file named `mydemo.app.bndrun`.

If you have a bundle `myappbundle` which contains `mydemo.app.bndrun`, then the build would create an executable jar at:

`/myappbundle/target/executable/mydemo.app.bndrun.jar`

Your build output looks like this:

```
[INFO] --- tycho-bnd:4.0.11:run (build) @ myappbundle ---
[INFO] Exporting mydemo.app.bndrun ...
[INFO] Exported to .../myappbundle/target/executable/tycho.demo.app.jar
```


## Mixed Builds

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).
Expand Down

0 comments on commit 0f43320

Please sign in to comment.