Skip to content

Commit

Permalink
SLCORE-1029: Shade/relocate JGit into OSGi bundle
Browse files Browse the repository at this point in the history
In order for SonarLint for Eclipse to make use of the same JGit version as SonarLint CORE uses, we shade/relocate it into the OSGi bundle as well.
  • Loading branch information
thahnen committed Nov 7, 2024
1 parent d51894f commit edf5d66
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
16 changes: 16 additions & 0 deletions client/java-client-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
<artifactId>org.eclipse.lsp4j.jsonrpc</artifactId>
<version>${lsp4j.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>${jgit.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -65,6 +75,8 @@
<includes>
<include>com.google.code.gson:gson</include>
<include>org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc</include>
<include>org.eclipse.jgit:org.eclipse.jgit</include>
<include>org.slf4j:slf4j-api</include>
</includes>
</artifactSet>

Expand All @@ -76,6 +88,8 @@
<includes>
<include>com.google.gson.**</include>
<include>org.eclipse.lsp4j.**</include>
<include>org.eclipse.jgit.**</include>
<include>org.slf4j.**</include>
</includes>
</relocation>
</relocations>
Expand All @@ -86,11 +100,13 @@
<artifact>*:*</artifact>
<excludes>
<exclude>module-info.class</exclude>
<exclude>about.html</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/LICENSE*</exclude>
<exclude>META-INF/NOTICE*</exclude>
<exclude>OSGI-INF/</exclude>
<exclude>LICENSE*</exclude>
<exclude>NOTICE*</exclude>
<exclude>*.proto</exclude>
Expand Down
7 changes: 4 additions & 3 deletions client/java-client-osgi/java-client-osgi.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Export-Package: org.sonarsource.sonarlint.core.commons.api.*;version="${project.
org.sonarsource.sonarlint.core.rpc.client.*;version="${project.version}",\
org.sonarsource.sonarlint.core.rpc.protocol.*;version="${project.version}",\
org.sonarsource.sonarlint.shaded.com.google.gson.*;version="${gson.version}",\
org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.*;version="${lsp4j.version}",
Import-Package: javax.annotation.*;resolution:=optional,\
org.eclipse.jgit.*;resolution:=optional,
org.sonarsource.sonarlint.shaded.org.eclipse.lsp4j.jsonrpc.*;version="${lsp4j.version}",\
org.sonarsource.sonarlint.shaded.org.eclipse.jgit.*;version="${jgit.version}",\\
org.sonarsource.sonarlint.shaded.org.slf4j.*;version="${slf4j.version}",
Import-Package: javax.annotation.*;resolution:=optional,
5 changes: 5 additions & 0 deletions client/java-client-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
<includes>
<include>com.google.gson.**</include>
<include>org.eclipse.lsp4j.**</include>
<include>org.eclipse.jgit.**</include>
<include>org.slf4j.**</include>
</includes>
</relocation>
</relocations>
Expand All @@ -164,6 +166,9 @@
<artifact>*:*</artifact>
<excludes>
<exclude>module-info.class</exclude>
<exclude>logback-shared.xml</exclude>
<exclude>plugins_min_versions.txt</exclude>
<exclude>sl_core_version.txt</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
Expand Down

0 comments on commit edf5d66

Please sign in to comment.