Eclipse JDT (Java development tools) is a very interesting piece of code, but it is not always easy to reuse it outside of Eclipse.
Since 2017 the jars are published on Maven Central, in a maven friendly way (no Maven Tycho required). This is a very good first step.
This talk will discuss two main pain points:
1) Consuming the jars directly from Maven Central
In the Eclipse world we are used to have "P2 Update Site" and "Target platform"… Those do not exist in the plain Maven world (there is only one repository: Maven central).
There are two main challenges:
- There is a mapping between the Bundle-SymbolicName and the coordinates in Maven.
- The dependencies are declared using version ranges, which is not that common in the Maven world.
The publication of a wrong pom.xml during the 2022.06 release is a perfect example to show the impact for the consumers.
Two interesting approaches will be presented:
- the "com.diffplug.eclipse.mavencentral" gradle plugin provided by the goomph project
- the BOM files published in the ECentral project
2) Some operations requires an OSGi runtime
Using the JDT code formatter feature can be executed from simple java main method. This is really easy.
Other features like modifying some Java code programmatically requires to be executed inside an OSGi runtime. It is not always easy to know how to sart an OSGi Framework and then to call some code (typically an OSGi Service) from the outside (your java main method that have started your equinox framework).
Tools like Bndtools can be used as well.