Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Shaded jar handling #6180

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
2 changes: 1 addition & 1 deletion 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.1.3.Final-SNAPSHOT</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
Loading