Skip to content

Commit

Permalink
Move the readme into correct place, add an example with configurator pom
Browse files Browse the repository at this point in the history
This moves the readme from .mvn into the root folder and also adds a new
template that includes a configurator
  • Loading branch information
laeubi committed Feb 4, 2025
1 parent ff5dbb6 commit 24c5be9
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
8 changes: 8 additions & 0 deletions setup/bnd-templates/pomless-configurator/.mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>${tycho-version}</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions setup/bnd-templates/pomless-configurator/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Dtycho-version=4.0.11
38 changes: 38 additions & 0 deletions setup/bnd-templates/pomless-configurator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Tycho Workspace template fragment for bndtools for pomless Maven build

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,
to add a Maven build based on Eclipse Tycho for your bnd workspace.

It creates a `.mvn` folder in your bnd workspace root, contain an `extensions.xml` and a `maven.config` and a `pom.xml` in your `cnf` folder for further configuration of the build.

See documentation for the [Tycho BND Plugin](https://tycho.eclipseprojects.io/doc/main/BndBuild.html) for more information.

## Building your workspace

```
cd mybndworkspace
mvn clean install
```

This is all you need to build your bnd workspace with Maven / Tycho.

It will automatically consider all `bnd.bnd` files.


## the configurator pom.xml

While the workspace build is pomless, you can configure additional aspects of your build in the configurator `pom.xml`
in your `cnf` folder.

## 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 your `.mvn/maven.config` file or pass it on the maven commandline:

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

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

33 changes: 33 additions & 0 deletions setup/bnd-templates/pomless-configurator/cnf/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.mygroup</groupId>
<artifactId>configurator</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<!-- properties can be defined -->
</properties>
<build>
<pluginManagement>
<!-- add your general plugin configuration here or customize the defaults -->
</pluginManagement>
</build>
<profiles>
<profile>
<id>file-activation-example</id>
<activation>
<file>
<exists>someFile</exists>
</file>
</activation>
<build>
<plugins>
<!-- add additional plugin configuration here that shoul be activated by a given file type -->
</plugins>
</build>
</profile>
</profiles>
</project>
File renamed without changes.

0 comments on commit 24c5be9

Please sign in to comment.