Skip to content

Commit db16879

Browse files
committed
1.1.3, fix shade-plugin config that disabled transitive dependencies
... and no longer build jar-with-dependencies by default
1 parent 8f01ce8 commit db16879

File tree

7 files changed

+138
-102
lines changed

7 files changed

+138
-102
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ For the Java 11 compiler:
6161
<dependency>
6262
<groupId>com.kohlschutter.jdk.compiler</groupId>
6363
<artifactId>standalone-jdk11</artifactId>
64-
<version>1.1.1</version>
64+
<version>1.1.3</version>
6565
</dependency>
6666
```
6767

@@ -71,7 +71,7 @@ For the Java 21 compiler (which runs on Java 11 or newer, even with JRE-only):
7171
<dependency>
7272
<groupId>com.kohlschutter.jdk.compiler</groupId>
7373
<artifactId>standalone-jdk11</artifactId>
74-
<version>1.1.1</version>
74+
<version>1.1.3</version>
7575
</dependency>
7676
```
7777

@@ -129,9 +129,15 @@ mvn clean install
129129
Also see [jdk.compiler.home](https://github.com/kohlschutter/jdk.compiler.home) for the
130130
corresponding JDK home artifact.
131131

132-
### Jar with dependencies
132+
### Executable jar with embedded dependencies
133133

134-
An executable jar with all dependencies is built automatically, and placed in
134+
Executable jar files (`java -jar ...`) are built with `-Djar-with-dependencies` enabled:
135+
136+
```
137+
mvn clean install -Djar-with-dependencies
138+
```
139+
140+
Executable jars are then placed in
135141
`standalone-jdk11/target/standalone-jdk11-VERSION-jar-with-dependencies.jar` (for JDK11) and
136142
`standalone-jdk21/target/standalone-jdk21-VERSION-jar-with-dependencies.jar` (for JDK21).
137143

@@ -145,7 +151,7 @@ a recent GraalVM SDK):
145151
mvn clean install -Dnative
146152
```
147153

148-
An executable jar with all dependencies is built automatically, and placed in
154+
Executables are then placed in
149155
`standalone-jdk11/target/standalone-jdk11-VERSION-javac` (for JDK11) and
150156
`standalone-jdk21/target/standalone-jdk21-VERSION-javac` (for JDK21).
151157

@@ -195,6 +201,11 @@ If you have an idea, please reach out!
195201

196202
### Changelog
197203

204+
#### _(2023-10-14)_ jdk.compiler.standalone 1.1.3
205+
206+
- Fix Maven POM setup that would prevent getting the correct dependencies in other projects, take 2
207+
- No longer build jar-with-dependencies by default
208+
198209
#### _(2023-10-14)_ jdk.compiler.standalone 1.1.2
199210

200211
- Fix Maven POM setup that would prevent getting the correct dependencies in other projects

pom.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@
1111

1212
<groupId>com.kohlschutter.jdk.compiler</groupId>
1313
<artifactId>standalone</artifactId>
14-
<version>1.1.2</version>
14+
<version>1.1.3</version>
1515
<packaging>pom</packaging>
1616

17-
<properties>
18-
<jdk.compiler.standalone.version>1.1.2</jdk.compiler.standalone.version>
19-
</properties>
20-
2117
<licenses>
2218
<license>
2319
<name>GPL-2.0-with-classpath-exception</name>
@@ -109,17 +105,20 @@
109105
<dependency>
110106
<groupId>com.kohlschutter.jdk</groupId>
111107
<artifactId>standalone-util</artifactId>
112-
<version>${jdk.compiler.standalone.version}</version>
108+
<version>${project.version}</version>
109+
<scope>compile</scope>
113110
</dependency>
114111
<dependency>
115112
<groupId>com.kohlschutter.jdk.compiler</groupId>
116113
<artifactId>standalone-jdk11</artifactId>
117-
<version>${jdk.compiler.standalone.version}</version>
114+
<version>${project.version}</version>
115+
<scope>compile</scope>
118116
</dependency>
119117
<dependency>
120118
<groupId>com.kohlschutter.jdk.compiler</groupId>
121119
<artifactId>standalone-jdk21</artifactId>
122-
<version>${jdk.compiler.standalone.version}</version>
120+
<version>${project.version}</version>
121+
<scope>compile</scope>
123122
</dependency>
124123
</dependencies>
125124
</dependencyManagement>

standalone-jdk11-test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.kohlschutter.jdk.compiler</groupId>
88
<artifactId>standalone</artifactId>
9-
<version>1.1.2</version>
9+
<version>1.1.3</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

standalone-jdk11/pom.xml

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.kohlschutter.jdk.compiler</groupId>
88
<artifactId>standalone</artifactId>
9-
<version>1.1.2</version>
9+
<version>1.1.3</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

@@ -92,48 +92,6 @@
9292
</execution>
9393
</executions>
9494
</plugin>
95-
96-
<plugin>
97-
<artifactId>maven-shade-plugin</artifactId>
98-
<executions>
99-
<execution>
100-
<id>jar-with-dependencies</id>
101-
<phase>package</phase>
102-
<goals>
103-
<goal>shade</goal>
104-
</goals>
105-
<configuration>
106-
<shadedArtifactAttached>true</shadedArtifactAttached>
107-
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
108-
<transformers>
109-
<transformer
110-
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
111-
<mainClass>
112-
standalone.com.sun.tools.javac.Main</mainClass>
113-
</transformer>
114-
<transformer
115-
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
116-
</transformers>
117-
<minimizeJar>false</minimizeJar>
118-
<filters>
119-
<filter>
120-
<artifact>*:*</artifact>
121-
<excludes>
122-
<exclude>/logging.properties</exclude>
123-
<exclude>META-INF/LICENSE</exclude>
124-
<exclude>META-INF/*.md</exclude>
125-
<exclude>META-INF/*.MF</exclude>
126-
<exclude>META-INF/*.SF</exclude>
127-
<exclude>META-INF/*.DSA</exclude>
128-
<exclude>META-INF/*.RSA</exclude>
129-
<exclude>META-INF/*.kotlin_module</exclude>
130-
</excludes>
131-
</filter>
132-
</filters>
133-
</configuration>
134-
</execution>
135-
</executions>
136-
</plugin>
13795
</plugins>
13896
</build>
13997

@@ -174,6 +132,61 @@
174132
</plugins>
175133
</build>
176134
</profile>
135+
<profile>
136+
<id>jar-with-dependencies</id>
137+
<activation>
138+
<property>
139+
<name>jar-with-dependencies</name>
140+
</property>
141+
</activation>
142+
<build>
143+
<plugins>
144+
<plugin>
145+
<artifactId>maven-shade-plugin</artifactId>
146+
<executions>
147+
<execution>
148+
<id>jar-with-dependencies</id>
149+
<phase>package</phase>
150+
<goals>
151+
<goal>shade</goal>
152+
</goals>
153+
<configuration>
154+
<createDependencyReducedPom>false</createDependencyReducedPom>
155+
<shadedArtifactAttached>true</shadedArtifactAttached>
156+
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
157+
<transformers>
158+
<transformer
159+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
160+
<mainClass>
161+
standalone.com.sun.tools.javac.Main</mainClass>
162+
</transformer>
163+
<transformer
164+
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
165+
</transformers>
166+
<minimizeJar>false</minimizeJar>
167+
<filters>
168+
<filter>
169+
<artifact>*:*</artifact>
170+
<excludes>
171+
<exclude>/logging.properties</exclude>
172+
<exclude>META-INF/LICENSE</exclude>
173+
<exclude>META-INF/*.md</exclude>
174+
<exclude>META-INF/*.MF</exclude>
175+
<exclude>META-INF/*.SF</exclude>
176+
<exclude>META-INF/*.DSA</exclude>
177+
<exclude>META-INF/*.RSA</exclude>
178+
<exclude>
179+
META-INF/*.kotlin_module</exclude>
180+
</excludes>
181+
</filter>
182+
</filters>
183+
</configuration>
184+
</execution>
185+
</executions>
186+
</plugin>
187+
</plugins>
188+
</build>
189+
</profile>
177190
</profiles>
178191

179192
<dependencies>

standalone-jdk21-test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.kohlschutter.jdk.compiler</groupId>
88
<artifactId>standalone</artifactId>
9-
<version>1.1.2</version>
9+
<version>1.1.3</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

standalone-jdk21/pom.xml

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.kohlschutter.jdk.compiler</groupId>
88
<artifactId>standalone</artifactId>
9-
<version>1.1.2</version>
9+
<version>1.1.3</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

@@ -183,48 +183,6 @@
183183
</execution>
184184
</executions>
185185
</plugin>
186-
187-
<plugin>
188-
<artifactId>maven-shade-plugin</artifactId>
189-
<executions>
190-
<execution>
191-
<id>jar-with-dependencies</id>
192-
<phase>package</phase>
193-
<goals>
194-
<goal>shade</goal>
195-
</goals>
196-
<configuration>
197-
<shadedArtifactAttached>true</shadedArtifactAttached>
198-
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
199-
<transformers>
200-
<transformer
201-
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
202-
<mainClass>
203-
standalone.com.sun.tools.javac.Main</mainClass>
204-
</transformer>
205-
<transformer
206-
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
207-
</transformers>
208-
<minimizeJar>false</minimizeJar>
209-
<filters>
210-
<filter>
211-
<artifact>*:*</artifact>
212-
<excludes>
213-
<exclude>/logging.properties</exclude>
214-
<exclude>META-INF/LICENSE</exclude>
215-
<exclude>META-INF/*.md</exclude>
216-
<exclude>META-INF/*.MF</exclude>
217-
<exclude>META-INF/*.SF</exclude>
218-
<exclude>META-INF/*.DSA</exclude>
219-
<exclude>META-INF/*.RSA</exclude>
220-
<exclude>META-INF/*.kotlin_module</exclude>
221-
</excludes>
222-
</filter>
223-
</filters>
224-
</configuration>
225-
</execution>
226-
</executions>
227-
</plugin>
228186
</plugins>
229187
</build>
230188

@@ -265,6 +223,61 @@
265223
</plugins>
266224
</build>
267225
</profile>
226+
<profile>
227+
<id>jar-with-dependencies</id>
228+
<activation>
229+
<property>
230+
<name>jar-with-dependencies</name>
231+
</property>
232+
</activation>
233+
<build>
234+
<plugins>
235+
<plugin>
236+
<artifactId>maven-shade-plugin</artifactId>
237+
<executions>
238+
<execution>
239+
<id>jar-with-dependencies</id>
240+
<phase>package</phase>
241+
<goals>
242+
<goal>shade</goal>
243+
</goals>
244+
<configuration>
245+
<createDependencyReducedPom>false</createDependencyReducedPom>
246+
<shadedArtifactAttached>true</shadedArtifactAttached>
247+
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
248+
<transformers>
249+
<transformer
250+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
251+
<mainClass>
252+
standalone.com.sun.tools.javac.Main</mainClass>
253+
</transformer>
254+
<transformer
255+
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
256+
</transformers>
257+
<minimizeJar>false</minimizeJar>
258+
<filters>
259+
<filter>
260+
<artifact>*:*</artifact>
261+
<excludes>
262+
<exclude>/logging.properties</exclude>
263+
<exclude>META-INF/LICENSE</exclude>
264+
<exclude>META-INF/*.md</exclude>
265+
<exclude>META-INF/*.MF</exclude>
266+
<exclude>META-INF/*.SF</exclude>
267+
<exclude>META-INF/*.DSA</exclude>
268+
<exclude>META-INF/*.RSA</exclude>
269+
<exclude>
270+
META-INF/*.kotlin_module</exclude>
271+
</excludes>
272+
</filter>
273+
</filters>
274+
</configuration>
275+
</execution>
276+
</executions>
277+
</plugin>
278+
</plugins>
279+
</build>
280+
</profile>
268281
</profiles>
269282

270283
<dependencies>

standalone-util/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.kohlschutter.jdk.compiler</groupId>
88
<artifactId>standalone</artifactId>
9-
<version>1.1.2</version>
9+
<version>1.1.3</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

0 commit comments

Comments
 (0)