Skip to content

Commit

Permalink
Fix for WFCORE-7019, Delay the construction of shaded jars at provisi…
Browse files Browse the repository at this point in the history
…oning time
  • Loading branch information
jfdenise committed Oct 15, 2024
1 parent f8eca17 commit 4909a6e
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 34 deletions.
21 changes: 21 additions & 0 deletions cli/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>shaded-model</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target/resources</directory>
<outputDirectory/>
</fileSet>
</fileSets>
<files>
<file>
<source>pom.xml</source>
<outputDirectory/>
</file>
</files>
</assembly>
45 changes: 45 additions & 0 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,51 @@
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.galleon-plugins</groupId>
<artifactId>wildfly-galleon-maven-plugin</artifactId>
<configuration>
<mainClass>org.jboss.as.cli.CommandLineMain</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
<!-- Use sharable JPMS settings declared in the root pom -->
<Add-Exports>${embedding.jar.jpms.exports}</Add-Exports>
<Add-Opens>${embedding.jar.jpms.opens}</Add-Opens>
</manifestEntries>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>generate-shaded-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<recompressZippedFiles>true</recompressZippedFiles>
<finalName>${project.build.finalName}-shaded</finalName>
<appendAssemblyId>true</appendAssemblyId>
<outputDirectory>${project.build.directory}</outputDirectory>
<workDirectory>${project.build.directory}/assembly/work</workDirectory>
<tarLongFileMode>gnu</tarLongFileMode>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
12 changes: 0 additions & 12 deletions core-feature-pack/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -635,18 +635,6 @@
<artifactId>wildfly-cli</artifactId>
</dependency>

<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-cli</artifactId>
<classifier>client</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-deployment-scanner</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
<package name="LICENSE.txt"/>
<package name="README.txt"/>
<package name="copyright.txt"/>
<!-- required in all cases, used during provisioning time -->
<package name="org.wildfly.core.wildfly-cli.shaded"/>
</dependencies>
</package-spec>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" ?>

<package-spec xmlns="urn:jboss:galleon:package:2.0" name="tools">
<dependencies>
<package name="org.wildfly.core.wildfly-cli.shaded"/>
<package name="org.wildfly.core.wildfly-elytron-tool-wrapper.shaded"/>
</dependencies>
</package-spec>
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
~ SPDX-License-Identifier: Apache-2.0
-->

<tasks xmlns="urn:wildfly:wildfly-feature-pack-tasks:2.0">
<tasks xmlns="urn:wildfly:wildfly-feature-pack-tasks:3.2">
<copy-artifact artifact="org.wildfly.core:wildfly-launcher" to-location="bin/launcher.jar"/>
<copy-artifact artifact="org.wildfly.core:wildfly-elytron-tool-wrapper" to-location="bin/wildfly-elytron-tool.jar"/>
<copy-artifact artifact="org.wildfly.core:wildfly-cli::client" to-location="bin/client/jboss-cli-client.jar"/>
<assemble-shaded-artifact shaded-model-package="org.wildfly.core.wildfly-elytron-tool-wrapper.shaded" to-location="bin/wildfly-elytron-tool.jar"/>
<assemble-shaded-artifact shaded-model-package="org.wildfly.core.wildfly-cli.shaded" to-location="bin/client/jboss-cli-client.jar"/>
<file-permissions phase="FINALIZING">
<permission value="755">
<filter pattern="bin/client/jboss-cli-client.jar" include="true"/>
Expand Down
32 changes: 32 additions & 0 deletions core-feature-pack/galleon-feature-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<common.resources.directory>${basedir}/../common/src/main/resources</common.resources.directory>
<ee-10-api.resources.directory>${basedir}/../ee-10-api/src/main/resources</ee-10-api.resources.directory>
<galleon-common.resources.directory>${basedir}/../galleon-common/src/main/resources</galleon-common.resources.directory>
<galleon-cli-shaded.resources.directory>${basedir}/../../cli/target/resources</galleon-cli-shaded.resources.directory>
<galleon-elytron-tools-shaded.resources.directory>${basedir}/../../elytron-tool-wrapper/target/resources</galleon-elytron-tools-shaded.resources.directory>
</properties>

<dependencies>
Expand Down Expand Up @@ -175,6 +177,36 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-galleon-cli-shaded-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/resources</outputDirectory>
<resources>
<resource>
<directory>${galleon-cli-shaded.resources.directory}</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-galleon-elytron-tools-shaded-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/resources</outputDirectory>
<resources>
<resource>
<directory>${galleon-elytron-tools-shaded.resources.directory}</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-resources</id>
<phase>process-resources</phase>
Expand Down
21 changes: 21 additions & 0 deletions elytron-tool-wrapper/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>shaded-model</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target/resources</directory>
<outputDirectory/>
</fileSet>
</fileSets>
<files>
<file>
<source>pom.xml</source>
<outputDirectory/>
</file>
</files>
</assembly>
43 changes: 31 additions & 12 deletions elytron-tool-wrapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,44 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<groupId>org.wildfly.galleon-plugins</groupId>
<artifactId>wildfly-galleon-maven-plugin</artifactId>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.wildfly.core.elytron.tool.wrapper.ElytronToolScriptWrapper</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
</transformers>
<mainClass>org.wildfly.core.elytron.tool.wrapper.ElytronToolScriptWrapper</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
<goal>generate-shaded-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<recompressZippedFiles>true</recompressZippedFiles>
<finalName>${project.build.finalName}-shaded</finalName>
<appendAssemblyId>true</appendAssemblyId>
<outputDirectory>${project.build.directory}</outputDirectory>
<workDirectory>${project.build.directory}/assembly/work</workDirectory>
<tarLongFileMode>gnu</tarLongFileMode>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<version.jacoco.plugin>0.8.10</version.jacoco.plugin>
<version.org.jboss.galleon>6.0.3.Final</version.org.jboss.galleon>
<version.org.wildfly.checkstyle-config>1.0.8.Final</version.org.wildfly.checkstyle-config>
<version.org.wildfly.galleon-plugins>7.1.2.Final</version.org.wildfly.galleon-plugins>
<version.org.wildfly.galleon-plugins>7.2.1.Final</version.org.wildfly.galleon-plugins>
<version.org.eclipse.m2e.lifecycle-mapping>1.0.0</version.org.eclipse.m2e.lifecycle-mapping>
<!-- wildfly-maven-plugin-->
<version.wildfly.plugin>5.0.1.Final</version.wildfly.plugin>
Expand Down Expand Up @@ -1333,12 +1333,6 @@
<artifactId>wildfly-cli</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-cli</artifactId>
<version>${project.version}</version>
<classifier>client</classifier>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-controller</artifactId>
Expand Down

0 comments on commit 4909a6e

Please sign in to comment.