Skip to content

Commit 6a209c6

Browse files
committed
Uses shaded eclipse dependencies in Gradle plugin
Update the Gradle plugin to use shaded Eclipse dependencies to prevent potential class clashes with other plugins. Closes gh-148
1 parent b2d47b5 commit 6a209c6

File tree

3 files changed

+91
-12
lines changed
  • spring-javaformat
  • spring-javaformat-gradle/spring-javaformat-gradle-plugin

3 files changed

+91
-12
lines changed

spring-javaformat-gradle/spring-javaformat-gradle-plugin/pom.xml

+1-12
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,9 @@
111111
<!-- Compile -->
112112
<dependency>
113113
<groupId>io.spring.javaformat</groupId>
114-
<artifactId>spring-javaformat-formatter</artifactId>
114+
<artifactId>spring-javaformat-formatter-shaded</artifactId>
115115
<version>${project.version}</version>
116116
</dependency>
117-
<dependency>
118-
<groupId>io.spring.javaformat</groupId>
119-
<artifactId>spring-javaformat-formatter-eclipse-runtime</artifactId>
120-
<version>${project.version}</version>
121-
<exclusions>
122-
<exclusion>
123-
<groupId>*</groupId>
124-
<artifactId>*</artifactId>
125-
</exclusion>
126-
</exclusions>
127-
</dependency>
128117
</dependencies>
129118
<profiles>
130119
<profile>

spring-javaformat/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@
3636
<module>spring-javaformat-formatter-eclipse-runtime</module>
3737
<module>spring-javaformat-formatter-eclipse</module>
3838
<module>spring-javaformat-formatter</module>
39+
<module>spring-javaformat-formatter-shaded</module>
3940
</modules>
4041
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>io.spring.javaformat</groupId>
8+
<artifactId>spring-javaformat</artifactId>
9+
<version>0.0.16-SNAPSHOT</version>
10+
</parent>
11+
<artifactId>spring-javaformat-formatter-shaded</artifactId>
12+
<name>Spring JavaFormat Formatter Shaded</name>
13+
<properties>
14+
<main.basedir>${basedir}/../..</main.basedir>
15+
</properties>
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>org.codehaus.mojo</groupId>
20+
<artifactId>flatten-maven-plugin</artifactId>
21+
<configuration>
22+
<updatePomFile>true</updatePomFile>
23+
<flattenMode>oss</flattenMode>
24+
<pomElements>
25+
<parent>expand</parent>
26+
<distributionManagement>remove</distributionManagement>
27+
<dependencies>remove</dependencies>
28+
<repositories>remove</repositories>
29+
</pomElements>
30+
</configuration>
31+
</plugin>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-shade-plugin</artifactId>
35+
<configuration>
36+
<createSourcesJar>true</createSourcesJar>
37+
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
38+
<createDependencyReducedPom>false</createDependencyReducedPom>
39+
<artifactSet>
40+
<includes>
41+
<include>io.spring.javaformat:*</include>
42+
</includes>
43+
</artifactSet>
44+
<relocations>
45+
<relocation>
46+
<pattern>org.eclipse</pattern>
47+
<shadedPattern>io.spring.javaformat.org.eclipse</shadedPattern>
48+
</relocation>
49+
<relocation>
50+
<pattern>com.ibm</pattern>
51+
<shadedPattern>io.spring.javaformat.com.ibm</shadedPattern>
52+
</relocation>
53+
<relocation>
54+
<pattern>org.osgi</pattern>
55+
<shadedPattern>io.spring.javaformat.org.osgi</shadedPattern>
56+
</relocation>
57+
</relocations>
58+
</configuration>
59+
<executions>
60+
<execution>
61+
<phase>package</phase>
62+
<goals>
63+
<goal>shade</goal>
64+
</goals>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
</plugins>
69+
</build>
70+
<dependencies>
71+
<!-- Provided -->
72+
<dependency>
73+
<groupId>io.spring.javaformat</groupId>
74+
<artifactId>spring-javaformat-formatter</artifactId>
75+
<version>${project.version}</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>io.spring.javaformat</groupId>
79+
<artifactId>spring-javaformat-formatter-eclipse-runtime</artifactId>
80+
<version>${project.version}</version>
81+
<exclusions>
82+
<exclusion>
83+
<groupId>*</groupId>
84+
<artifactId>*</artifactId>
85+
</exclusion>
86+
</exclusions>
87+
</dependency>
88+
</dependencies>
89+
</project>

0 commit comments

Comments
 (0)