Skip to content

Commit

Permalink
1.1.3, fix shade-plugin config that disabled transitive dependencies
Browse files Browse the repository at this point in the history
... and no longer build jar-with-dependencies by default
  • Loading branch information
kohlschuetter committed Oct 14, 2023
1 parent 8f01ce8 commit db16879
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 102 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ For the Java 11 compiler:
<dependency>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone-jdk11</artifactId>
<version>1.1.1</version>
<version>1.1.3</version>
</dependency>
```

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

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

### Jar with dependencies
### Executable jar with embedded dependencies

An executable jar with all dependencies is built automatically, and placed in
Executable jar files (`java -jar ...`) are built with `-Djar-with-dependencies` enabled:

```
mvn clean install -Djar-with-dependencies
```

Executable jars are then placed in
`standalone-jdk11/target/standalone-jdk11-VERSION-jar-with-dependencies.jar` (for JDK11) and
`standalone-jdk21/target/standalone-jdk21-VERSION-jar-with-dependencies.jar` (for JDK21).

Expand All @@ -145,7 +151,7 @@ a recent GraalVM SDK):
mvn clean install -Dnative
```

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

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

### Changelog

#### _(2023-10-14)_ jdk.compiler.standalone 1.1.3

- Fix Maven POM setup that would prevent getting the correct dependencies in other projects, take 2
- No longer build jar-with-dependencies by default

#### _(2023-10-14)_ jdk.compiler.standalone 1.1.2

- Fix Maven POM setup that would prevent getting the correct dependencies in other projects
Expand Down
15 changes: 7 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@

<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<packaging>pom</packaging>

<properties>
<jdk.compiler.standalone.version>1.1.2</jdk.compiler.standalone.version>
</properties>

<licenses>
<license>
<name>GPL-2.0-with-classpath-exception</name>
Expand Down Expand Up @@ -109,17 +105,20 @@
<dependency>
<groupId>com.kohlschutter.jdk</groupId>
<artifactId>standalone-util</artifactId>
<version>${jdk.compiler.standalone.version}</version>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone-jdk11</artifactId>
<version>${jdk.compiler.standalone.version}</version>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone-jdk21</artifactId>
<version>${jdk.compiler.standalone.version}</version>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion standalone-jdk11-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
99 changes: 56 additions & 43 deletions standalone-jdk11/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -92,48 +92,6 @@
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>
standalone.com.sun.tools.javac.Main</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<minimizeJar>false</minimizeJar>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>/logging.properties</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/*.md</exclude>
<exclude>META-INF/*.MF</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.kotlin_module</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -174,6 +132,61 @@
</plugins>
</build>
</profile>
<profile>
<id>jar-with-dependencies</id>
<activation>
<property>
<name>jar-with-dependencies</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>
standalone.com.sun.tools.javac.Main</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<minimizeJar>false</minimizeJar>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>/logging.properties</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/*.md</exclude>
<exclude>META-INF/*.MF</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>
META-INF/*.kotlin_module</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion standalone-jdk21-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
99 changes: 56 additions & 43 deletions standalone-jdk21/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -183,48 +183,6 @@
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>
standalone.com.sun.tools.javac.Main</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<minimizeJar>false</minimizeJar>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>/logging.properties</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/*.md</exclude>
<exclude>META-INF/*.MF</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.kotlin_module</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -265,6 +223,61 @@
</plugins>
</build>
</profile>
<profile>
<id>jar-with-dependencies</id>
<activation>
<property>
<name>jar-with-dependencies</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>
standalone.com.sun.tools.javac.Main</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<minimizeJar>false</minimizeJar>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>/logging.properties</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/*.md</exclude>
<exclude>META-INF/*.MF</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>
META-INF/*.kotlin_module</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion standalone-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.kohlschutter.jdk.compiler</groupId>
<artifactId>standalone</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit db16879

Please sign in to comment.