Skip to content

Commit

Permalink
Merge pull request #6068 from chrisrueger/improve-repositories-docu
Browse files Browse the repository at this point in the history
Improve repositories docu
  • Loading branch information
pkriens committed Apr 3, 2024
2 parents 446dcdc + 1c5e635 commit 37e724b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 21 deletions.
Expand Up @@ -312,7 +312,7 @@ public synchronized void setProperties(Map<String, String> map) {
try {
this.cacheTimeoutSeconds = Integer.parseInt(map.get(PROP_CACHE_TIMEOUT));
} catch (NumberFormatException e) {
error("Bad timeout setting. Must be integer number of milliseconds.");
error("Bad timeout setting. Must be integer number of seconds.");
}
}

Expand Down
13 changes: 12 additions & 1 deletion docs/_plugins/filerepo.md
Expand Up @@ -2,4 +2,15 @@
title: FileRepo Plugin
layout: default
summary: Provides a bnd repository stored on the local file system
---
---

This type of repository is based on a very simple file system directory structure. It is editable from within Bndtools. **NB:** it does not support indexing, so repositories of this type cannot participate in resolution of Run Requirements.

The following properties are supported:

| Name | Description | Required? |
|---------|----------------------------------------------|---------------------------------------------|
|`name` | Name for the repository. | No. |
|`location` | The local filesystem directory. | Yes. |
|`readonly` |Whether the repository should be read-only,| No. Default: false |
| |i.e. disabled for editing from Bndtools.| |
37 changes: 22 additions & 15 deletions docs/_plugins/localindexrepo.md
Expand Up @@ -10,20 +10,28 @@ Bnd stores information about bundles it knows in an index, following the [OSGi R

The class name of the plugin is `aQute.bnd.deployer.repository.LocalIndexRepo`. It can take the following configuration properties:

| Property | Type | Default | Description |
| ----------- | --------- | ------- | ------------------------------------------------------------ |
| `name` | `NAME | | The name of the repository. |
| `local` | `STRING` | | The directory the index and added bundles will be stored in |
| `locations` | `STRING` | | The location to store the _index_ file. |
| `readonly` | `BOOLEAN` | `false` | Blocks write access to the repository |
| `overwrite` | `BOOLEAN` | `false` | Enable overwrite of existing Bundles. By default Bundles with the same Versions will not be added again |
| `onlydirs` | `BOOLEAN` | `false` | A comma separated list of directories relative to the `local`property to be whitelisted for this repo (used when the index is created) |
| `.cache` | `STRING` | | |
| `pretty` | `BOOLEAN` | `false` | |
| `phase` | `STRING` | | |
| `timeout` | `integer` | | |
| `online` | `BOOLEAN` | `false` | |
| `type` | `STRING` | | |
Merging the information from both tables into one, we get the following comprehensive table:

| Property | Type | Default | Description | Required? |
|-------------|-----------|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| `name` | `NAME` | | The name of the repository. | No |
| `local` | `STRING` | | The directory the index and added bundles will be stored in | Yes |
| `locations` | `STRING` | empty | The location to store the _index_ file. Comma-separated list of *additional* index URLs. **NB:** surround this value with single-quotes if it contains more than one entry. | No. |
| `readonly` | `BOOLEAN` | `false` | Blocks write access to the repository. Whether the repository should be read-only, i.e., disabled for editing from Bndtools. | No. |
| `overwrite` | `BOOLEAN` | `false` | Enable overwrite of existing Bundles. By default, Bundles with the same Versions will not be added again. | |
| `onlydirs` | `BOOLEAN` | `false` | A comma-separated list of directories relative to the `local` property to be whitelisted for this repo (used when the index is created). | |
| `cache` | `STRING` | `${local}/.cache` | Local cache directory for remote resources. | No. |
| `pretty` | `BOOLEAN` | `false` | Whether to generate the index in printed format. See _Note 2_ below. | No. |
| `phase` | `STRING` | | Controls the resolution phase in which this repository may be used: `build`, `runtime` or `any` | |
| `timeout` | `integer` | | If there is a cached file, then just use it if the cached file is within the `timeout` period OR `online` is `false`. | |
| `online` | `BOOLEAN` | `true` | Specifies if this repository is online. If `false` then cached resources are used. | |
| `type` | `STRING` | `R5` | The type (format) of index to generate. See _Note 1_ below. | No. |

**Note 1**: The index is generated by default in R5 format. To request alternative format(s), specify a list of format names separated by the "|" (pipe) character.
For example, to generate both R5 and OBR formats specify `type=R5|OBR`.

**Note 2**: R5 indexes are generated by default with no whitespace/indenting and gzipped, and the default index file name is `index.xml.gz`. Turning on pretty-printing enables indented, uncompressed output into the file `index.xml`. This setting has no effect on OBR indexes, which are always indented/uncompressed and named `repository.xml`.


## Example

Expand All @@ -33,4 +41,3 @@ The class name of the plugin is `aQute.bnd.deployer.repository.LocalIndexRepo`.
pretty = true; \
local = ${build}/release
```

6 changes: 2 additions & 4 deletions docs/_plugins/osgirepo.md
Expand Up @@ -15,19 +15,17 @@ The class name of the plugin is `aQute.bnd.repository.osgi.OSGiRepository`. It c
| `name` | `NAME`| | The name of the repository.|
| `locations` | `STRING`| | A Comma separate list of URLs point to an OSGi Resource file.|
| `cache` | `STRING`| The workspace cache folder | The location, the downloaded bundles are stored. |
| `max.stale` | `integer` | one year | Bnd has it's own download cache. `max.stale` configures for how many _seconds_ the downloaded index file stays in the internal download cache. |
| `max.stale` | `integer` | one year | Bnd has it's own download cache. `max.stale` configures for how many _seconds_ the downloaded index file stays in the internal download cache. Use _-1_ to always check if there is a newer file on the server. |
| `poll.time` | `integer` | 5 seconds | Number of seconds between checks for polls on the `index` file. If the value is negative or the workspace is in batch/CI mode, then no polling takes place. |

## Example

To set up the `OSGi Repository` use:

aQute.bnd.repository.osgi.OSGiRepository;\
locations=https://devel.data-in-motion.biz/public/repository/gecko/release/geckoREST/index.xml;\
locations=https://devel.data-in-motion.biz/repository/gecko/release/geckoREST/index.xml;\
max.stale=-1;\
poll.time=86400;\
name=GeckoJaxRsWhiteboard;\
cache=${build}/cache/GeckoREST,\


##

0 comments on commit 37e724b

Please sign in to comment.