Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2090196

Browse files
committedJan 17, 2025·
Create a tycho-baseline:check-dependencies mojo to validate versions
If version ranges on packages or bundles are used it is currently quite hard to ensure these are actually work for the provided ranges especially if they evolve over a long time. This now adds a new tycho-baseline:check-dependencies mojo that can help in this task by inspecting the byte-code of the project and the dependencies if there is any inconsistency in any of the dependencies matching the version range.
1 parent 61ec2ff commit 2090196

File tree

18 files changed

+1875
-568
lines changed

18 files changed

+1875
-568
lines changed
 

‎RELEASE_NOTES.md

+32
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,38 @@ All of the following variants to specify a version are now possible:
3232
</target>
3333
```
3434

35+
## new `check-dependencies` mojo
36+
37+
When using version ranges there is a certain risk that one actually uses some methods from never release and it goes unnoticed.
38+
39+
There is now a new `tycho-baseline:dependencies mojo` that analyze the compiled class files for used method references and compares them to
40+
the individual artifacts that match the version range. To find these versions it uses the maven metadata stored in P2 as well as
41+
the eclipse-repository index to find possible candidates.
42+
43+
If any problems are found, these are written by default to `target/versionProblems.txt` but one can also enable to update the version ranges
44+
according to the discovered problems, a configuration for this might look like this:
45+
46+
```xml
47+
<plugin>
48+
<groupId>org.eclipse.tycho</groupId>
49+
<artifactId>tycho-baseline-plugin</artifactId>
50+
<version>${tycho.version}</version>
51+
<executions>
52+
<execution>
53+
<id>checkit</id>
54+
<goals>
55+
<goal>check-dependencies</goal>
56+
</goals>
57+
<configuration>
58+
<applySuggestions>true</applySuggestions>
59+
</configuration>
60+
</execution>
61+
</executions>
62+
</plugin
63+
```
64+
65+
Because this can be a time consuming task to fetch all matching versions it is best placed inside a profile that is enabled on demand.
66+
3567
## new `update-manifest` mojo
3668

3769
It is recommended to use as the lower bound the dependency the code was

‎tycho-baseline-plugin/pom.xml

+14
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,27 @@
5353
<artifactId>asciitable</artifactId>
5454
<version>0.3.2</version>
5555
</dependency>
56+
<dependency>
57+
<groupId>org.ow2.asm</groupId>
58+
<artifactId>asm</artifactId>
59+
<version>9.7.1</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.eclipse.emf</groupId>
63+
<artifactId>org.eclipse.emf.ecore</artifactId>
64+
<version>2.38.0</version>
65+
</dependency>
5666
</dependencies>
5767
<build>
5868
<plugins>
5969
<plugin>
6070
<groupId>org.codehaus.plexus</groupId>
6171
<artifactId>plexus-component-metadata</artifactId>
6272
</plugin>
73+
<plugin>
74+
<groupId>org.eclipse.sisu</groupId>
75+
<artifactId>sisu-maven-plugin</artifactId>
76+
</plugin>
6377
<plugin>
6478
<groupId>org.apache.maven.plugins</groupId>
6579
<artifactId>maven-plugin-plugin</artifactId>

0 commit comments

Comments
 (0)
Please sign in to comment.