Skip to content

Commit

Permalink
Create a tycho-baseline:check-dependencies mojo to validate versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laeubi committed Jan 17, 2025
1 parent 61ec2ff commit 2090196
Show file tree
Hide file tree
Showing 18 changed files with 1,875 additions and 568 deletions.
32 changes: 32 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,38 @@ All of the following variants to specify a version are now possible:
</target>
```

## new `check-dependencies` mojo

When using version ranges there is a certain risk that one actually uses some methods from never release and it goes unnoticed.

There is now a new `tycho-baseline:dependencies mojo` that analyze the compiled class files for used method references and compares them to
the individual artifacts that match the version range. To find these versions it uses the maven metadata stored in P2 as well as
the eclipse-repository index to find possible candidates.

If any problems are found, these are written by default to `target/versionProblems.txt` but one can also enable to update the version ranges
according to the discovered problems, a configuration for this might look like this:

```xml
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-baseline-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>checkit</id>
<goals>
<goal>check-dependencies</goal>
</goals>
<configuration>
<applySuggestions>true</applySuggestions>
</configuration>
</execution>
</executions>
</plugin
```

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.

## new `update-manifest` mojo

It is recommended to use as the lower bound the dependency the code was
Expand Down
14 changes: 14 additions & 0 deletions tycho-baseline-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,27 @@
<artifactId>asciitable</artifactId>
<version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.7.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.38.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
</plugin>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
Expand Down
Loading

0 comments on commit 2090196

Please sign in to comment.