Skip to content

Commit 6246117

Browse files
Copilotlaeubi
andauthored
Improve documentation for P2 transport cache and -U option (#5817)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
1 parent b0c6180 commit 6246117

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

src/site/markdown/SystemProperties.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,33 @@ eclipse.p2.maxDownloadAttempts | _any positive integer_ | 3 | Describes how ofte
3838

3939
### Tycho P2 Transport
4040

41-
These properties control how Tycho downloads artifacts from P2 servers
41+
These properties control how Tycho downloads artifacts from P2 servers.
42+
43+
#### Cache Behavior and the `-U` Option
44+
45+
Tycho's P2 transport uses a cache to improve build performance by avoiding repeated downloads of unchanged remote resources. The cache stores HTTP responses, including successful downloads and error responses (like 404 Not Found).
46+
47+
**Important:** The Maven `-U` (or `--update-snapshots`) command-line option forces Tycho to bypass the cache and re-check all remote P2 repositories. This is useful when:
48+
49+
- A P2 repository was recently published or updated and the cache contains stale data
50+
- A previous build failed because a repository was temporarily unavailable (the 404 response may be cached)
51+
- You need to ensure you have the latest versions of all artifacts
52+
53+
Example usage:
54+
```bash
55+
mvn clean verify -U
56+
```
57+
58+
The `-U` option takes precedence over the `tycho.p2.transport.min-cache-minutes` setting - when `-U` is specified, the cache is always bypassed regardless of the configured cache duration.
59+
60+
#### Transport Properties
4261

4362
Name | Value | Default | Documentation
4463
--- | --- | --- | ---
4564
tycho.p2.transport.cache | file path | local maven repository | Specify the location where Tycho stores certain cache files to speed up successive builds
4665
tycho.p2.transport.debug | true/false | false | enable debugging of the Tycho Transport
4766
tycho.p2.transport.max-download-threads | number | 4 | maximum number of threads that should be used to download artifacts in parallel
48-
tycho.p2.transport.min-cache-minutes | number | 60 | Number of minutes that a cache entry is assumed to be fresh and is not fetched again from the server
67+
tycho.p2.transport.min-cache-minutes | number | 60 | Number of minutes that a cache entry is assumed to be fresh and is not fetched again from the server. Use `-U` on the command line to force an immediate refresh regardless of this setting.
4968
tycho.p2.transport.bundlepools.priority | number | 100 | priority used for bundle pools
5069
tycho.p2.transport.bundlepools.shared | true/false | true | query shared bundle pools for artifacts before downloading them from remote servers
5170
tycho.p2.transport.bundlepools.workspace | true/false | true | query Workspace bundle pools for artifacts before downloading them from remote servers

src/site/markdown/Troubleshooting.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,31 @@ Tycho complains about missing or invalid p2 metadata.
4242
2. **Update site refresh**: If using local repositories, ensure they are properly generated
4343
3. **Clear local cache**: Remove `~/.m2/repository/p2` to force re-download of metadata
4444

45+
## Cached Repository Errors
46+
47+
### Problem
48+
A build fails with "No repository found" or similar errors even though the repository is now available. This often happens when:
49+
- A p2 repository was temporarily unavailable during a previous build
50+
- A repository was recently published or updated
51+
- Your build previously ran when network connectivity was intermittent
52+
53+
Tycho caches HTTP responses (including error responses like 404 Not Found) to improve build performance. If a repository lookup failed during a previous build, that failure may be cached.
54+
55+
### Solution
56+
Use the Maven `-U` (or `--update-snapshots`) flag to force Tycho to bypass the cache and re-check all remote repositories:
57+
58+
```bash
59+
mvn clean verify -U
60+
```
61+
62+
This is the recommended approach when you suspect cached data is stale.
63+
64+
Alternatively, you can:
65+
1. **Wait for cache expiration**: By default, cache entries are considered fresh for 60 minutes (configurable via `tycho.p2.transport.min-cache-minutes`)
66+
2. **Clear the transport cache**: Delete the cache directory located at `~/.m2/repository/.cache/tycho` (or the location specified by `tycho.p2.transport.cache`)
67+
68+
For more details on cache configuration options, see [System Properties](SystemProperties.html#tycho-p2-transport).
69+
4570
## Platform-Specific Dependencies
4671

4772
### Problem

0 commit comments

Comments
 (0)