Skip to content

Commit 8d4d6e2

Browse files
authored
Merge pull request #169 from chrisrueger/improve-repo-maxstale-docu
update max.stale description
2 parents 4194b51 + fb4d16b commit 8d4d6e2

File tree

1 file changed

+46
-106
lines changed

1 file changed

+46
-106
lines changed

_manual/repositories-view.md

Lines changed: 46 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -6,159 +6,99 @@ author: Neil Bartlett
66

77
<img src="/images/repositories-view.png" style="width:461px" class="view">
88

9-
Bndtools uses *repositories* to supply dependencies to be used at build-time and at runtime. A repository is essentially a collection of bundles, optionally with some kind of index. It may be located anywhere: in the workspace; somewhere else on the local file system; or on a remote server.
9+
Bndtools uses *repositories* to supply dependencies to be used at build-time and at runtime.
10+
11+
A repository is essentially
12+
13+
- a collection of bundles
14+
- optionally with some kind of index.
15+
16+
It may be located anywhere:
17+
- in the workspace
18+
- somewhere else on the local file system
19+
- or on a remote server.
1020

1121
Bndtools uses repositories in the following ways:
1222

1323
* To look up bundles specified on the Build Path by Bundle Symbolic Name (BSN) and version;
1424
* To resolve the Run Requirements list;
1525
* To look up bundles specified in the Run Bundles list by BSN and version.
1626

17-
Repositories are implemented as bnd plug-ins, and can be configured by editing the Plugins sections of the workspace configuration file (*Bndtools* menu » *Open main bnd config*).
27+
Repositories are implemented as [bnd plug-ins](https://bnd.bndtools.org/chapters/870-plugins.html), and can be configured by editing the Plugins sections of the workspace configuration file (*Bndtools* menu » *Open main bnd config*).
1828

1929
![](/images/concepts/repositories01.png)
2030

2131
Since repositories are implemented as plug-ins, it is theoretically possible to support almost any kind of repository, by developing a new plug-in type; though of course it is more convenient to use an existing repository plug-in. Bnd and Bndtools support the following repository types out-of-the-box.
2232

23-
Indexed Repositories
24-
====================
33+
34+
## Indexed Repositories
2535

2636
Bndtools supports a collection of repositories based on an _index_ file that reports the content of the repository along with the capabilities and requirements of each resource listed. There are multiple available formats for the index:
2737

28-
* OBR, named after the [OSGi Bundle Repository](http://www.osgi.org/Repository/BIndex) pseudo-standard. This format is obsolete but still used by some parts of the OSGi ecosystem.
38+
* OBR, named after the _OSGi Bundle Repository_ pseudo-standard. This format is obsolete but still used by some parts of the OSGi ecosystem.
2939
* R5, named after OSGi Release 5 which introduced a true specification for OSGi Repositories. The format of this index is described in the OSGi Release 5 Enterprise specification, section 132.5.
3040
* Other arbitrary formats may be supported by the addition of a `IRepositoryContentProvider` plugin.
3141

3242
The advantage of using indexed repositories is that they can be used for automatic Resolution in the bndrun editor. There are two basic types of indexed repositories:
3343

34-
OSGiRepositories / Fixed Index Repositories
35-
------------------------
36-
37-
**Note! The Fixed Index Repository type is Deprecated and currently extends the OSGiRepository without any additional behavior. It will be removed at some point in the future. Please use the OSGiRepository.**
38-
39-
The OSGiRepository can use index files compatible to the [OSGi Repository Service Specification](https://osgi.org/specification/osgi.cmpn/7.0.0/service.repository.html#i3247820), which is located anywhere, so long as the location can be addressed in the form of a URL. For example the index can be located on the local filesystem and addressed via a `file:` URL, or it can be located on a remote HTTP(s) server. The locations of the actual resources -- i.e. JAR files -- is specified by URLs embedded in the index file itself, and so they can also be either local or remote. In the case of remote index and/or resources, a local cache is used to avoid repeated downloads and to enable offline builds.
44+
### Maven Central (MavenBndRepository)
4045

41-
A OSGiRepository can not be modified from within bnd or Bndtools.
46+
This repository is one of "indexed" repositories, therefore `index` property poits to `central.maven` file that contains `GAV coordinates` to libraries located in Maven Central.
4247

43-
The following properties are supported:
48+
Hint: When this file is empty, the attempt to view the contents of the repository using the Repositories View in Bndtools, it will appear to be empty as well.
4449

45-
| Name | Description | Required? |
46-
|---------|----------------------------------------------|---------------------------------------------|
47-
|`name` | Name for the repository. | No. |
48-
|`locations`|Comma-separated list of index URLs. | No. Default: empty |
49-
| |**NB:** surround this value with | |
50-
| |single-quotes if it contains more than one | |
51-
| |entry. | |
52-
|`cache` | Local cache directory for remote | No. Default: `${user.home}/.bnd/cache/` |
53-
| | resources. | |
54-
|`max.stale` | The time (in seconds) a cached entry stays in| No. Default: `1 Year` |
55-
| | the cache | |
56-
|`poll.time` | The interval (in seconds) the index is polled| No. Default: `5 Minutes` |
57-
| | for updates (Note: The cache will be used) | |
50+
`central.maven` file doesn't fill itself automatically. Think of this repository like an empty `<dependencies>` section in maven.
51+
In order to fill it you need to add [GAVs](https://bnd.bndtools.org/plugins/maven.html#coordinates--terminology) (one per line) to it.
5852

5953
Example:
60-
6154
```
62-
aQute.bnd.repository.osgi.OSGiRepository;\
63-
locations=https://dl.bintray.com/bnd/dist/4.0.0/index.xml;\
64-
name=BND;\
65-
poll.time=3600;\
66-
max.stale=-1;\
67-
cache=${build}/bache/bnd
55+
# List repository contents using GAV coordinates
56+
org.apache.camel:camel-core:2.23.1
6857
```
6958

70-
The index file may optionally be compressed with gzip.
59+
There is also posibility use drag&drop on `pom` file.
60+
In order to do that:
61+
1. Search maven repository https://mvnrepository.com particular jar
62+
2. Select desired version
63+
3. Click `View All` under `Files` section
64+
4. Locate the main pom file and drag&drop it over `Maven Central` repository in `Repositories` view
65+
This action will fill the file for you.
7166

72-
Local Indexed Repository
73-
------------------------
67+
- [See the configuration properties and examples in the bnd manual](https://bnd.bndtools.org/plugins/maven.html)
7468

75-
This repository maintains a local filesystem directory of bundles. The repository is editable from with bnd/Bndtools and the index file is regenerated automatically when bundles are deployed into it.
7669

77-
The following properties are supported:
70+
### OSGiRepositories / Fixed Index Repositories
7871

79-
| Name | Description | Required? |
80-
|---------|----------------------------------------------|---------------------------------------------|
81-
|`name` | Name for the repository. | No. |
82-
|`local` | The local filesystem directory. | Yes. |
83-
|`type` |The type (format) of index to generate. See |No. Default: `R5`|
84-
| |note 1 below. | |
85-
|`pretty` | Whether to generate the index in pretty- | No. Default: false|
86-
| | printed format. See note 2 below. | |
87-
|`readonly` |Whether the repository should be read-only, | No. Default: false |
88-
| | i.e. disabled for editing from Bndtools. | |
89-
|`mode` | Resolution mode: `build`, `runtime` or `any`. |No. Default: `any`|
90-
| | Controls the resolution phase in which this | |
91-
| | repository may be used. | |
92-
| `locations` | Comma-separated list of *additional* index | No. Default: empty|
93-
| | URLs. **NB:** surround this value with | |
94-
| | single-quotes if it contains more than one | |
95-
| | entry. | |
96-
|`cache` | Local cache directory for remote | No. Default: `${local}/.cache`|
97-
| | resources. | |
98-
99-
100-
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.
101-
For example, to generate both R5 and OBR formats specify `type=R5|OBR`.
72+
**Note! The Fixed Index Repository type is Deprecated and currently extends the OSGiRepository without any additional behavior. It will be removed at some point in the future. Please use the OSGiRepository.**
10273

103-
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`.
74+
The OSGiRepository can use index files compatible to the [OSGi Repository Service Specification](https://osgi.org/specification/osgi.cmpn/7.0.0/service.repository.html#i3247820), which is located anywhere, so long as the location can be addressed in the form of a URL. For example the index can be located on the local filesystem and addressed via a `file:` URL, or it can be located on a remote HTTP(s) server. The locations of the actual resources -- i.e. JAR files -- is specified by URLs embedded in the index file itself, and so they can also be either local or remote. In the case of remote index and/or resources, a local cache is used to avoid repeated downloads and to enable offline builds.
10475

105-
File Repository
106-
===============
76+
A OSGiRepository can not be modified from within bnd or Bndtools.
10777

108-
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.
78+
- [See the configuration properties and examples in the bnd manual](https://bnd.bndtools.org/plugins/osgirepo.html)
10979

110-
The following properties are supported:
11180

112-
| Name | Description | Required? |
113-
|---------|----------------------------------------------|---------------------------------------------|
114-
|`name` | Name for the repository. | No. |
115-
|`location` | The local filesystem directory. | Yes. |
116-
|`readonly` |Whether the repository should be read-only,| No. Default: false |
117-
| |i.e. disabled for editing from Bndtools.| |
81+
### Local Indexed Repository
11882

119-
Maven Repositories
120-
===========================
83+
This repository maintains a local filesystem directory of bundles. The repository is editable from with bnd/Bndtools and the index file is regenerated automatically when bundles are deployed into it.
12184

122-
## Maven Central ##
85+
- [See the configuration properties and examples in the bnd manual](https://bnd.bndtools.org/plugins/localindexrepo.html)
12386

124-
Maven Central repository is configured in main bnd config file (`cnf/build.bnd`) as:
125-
```
126-
-plugin.6.Central: \
127-
aQute.bnd.repository.maven.provider.MavenBndRepository; \
128-
releaseUrl=https://repo.maven.apache.org/maven2/; \
129-
index=${.}/central.maven; \
130-
readOnly=true; \
131-
name="Maven Central"
132-
```
133-
This repository is one of "indexed" repositories, therefore `index` property poits to `central.maven` file that contains `GAV coordinates` to libraries located in Maven Central.
13487

135-
Hint: When this file is empty, the attempt to view the contents of the repository using the Repositories View in Bndtools, it will appear to be empty as well.
88+
### File Repository
13689

137-
`central.maven` file doesn't fill itself automatically. Think of this repository like an empty `<dependencies>` section in maven.
138-
In order to fill it you need to add [GAVs](https://bnd.bndtools.org/plugins/maven.html#coordinates--terminology) (one per line) to it.
90+
This type of repository is based on a very simple file system directory structure.
13991

140-
Example:
141-
```
142-
# List repository contents using GAV coordinates
143-
org.apache.camel:camel-core:2.23.1
144-
```
92+
- [See the configuration properties and examples in the bnd manual](https://bnd.bndtools.org/plugins/filerepo.html)
14593

146-
There is also posibility use drag&drop on `pom` file.
147-
In order to do that:
148-
1. Search maven repository https://mvnrepository.com particular jar
149-
2. Select desired version
150-
3. Click `View All` under `Files` section
151-
4. Locate the main pom file and drag&drop it over `Maven Central` repository in `Repositories` view
152-
This action will fill the file for you.
94+
<hr />
15395

154-
TODO update for current repository types which support Maven repos.
96+
## Maven Repositories (Old Style)
15597

156-
Maven Repositories (Old Style)
157-
==============================
15898

15999
**NB. The repository types in this section are deprecated. Please use the Aether Repository type instead. The following documentation is retained for reference purposes only.**
160100

161-
## Maven Local ##
101+
### Maven Local
162102

163103
This type of repository is used to access bundles in the Maven local repository, usually found in `$HOME/.m2/repository`. Note that this plug-in accesses the Maven repository directly and does not building with Maven.
164104

@@ -168,14 +108,14 @@ This type of repository is used to access bundles in the Maven local repository,
168108
|`root` | The location of the Maven repository. | No. Default: `$HOME/.m2/repository` |
169109

170110

171-
Note that if you use the [Bundle Plugin for Maven](http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html) then you can also use the OBR repository type, since the Bundle Plugin generates an OBR index file whenever `maven install` is executed. For example:
111+
Note that if you use the [Bundle Plugin for Maven](https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html) then you can also use the OBR repository type, since the Bundle Plugin generates an OBR index file whenever `maven install` is executed. For example:
172112

173113
aQute.bnd.repository.osgi.OSGiRepository;\
174114
locations='file:${user.home}/.m2/repository/repository.xml';\
175115
name='Maven Repo'
176116

177117

178-
## Maven Remote ##
118+
### Maven Remote
179119

180120
This type of repository can be used to access bundles in a remote Maven repository, including Maven Central or any Nexus repository. **NB:** this repository type is not browseable; if you attempt to view the contents of the repository using the Repositories View in Bndtools, it will appear to be empty. However it will be possible to reference JARs from the repository in your `-buildpath` or `-runbundles` if the group ID and artefact ID is known.
181121

0 commit comments

Comments
 (0)