[java-metadata-aggregator] branch main updated: JPAR-182 - Avoid use of dependencySet in assembly descriptor

Ian Young ian at iay.org.uk
Thu Feb 10 14:38:24 UTC 2022


This is an automated email from the git hooks/post-receive script.

iay pushed a commit to branch main
in repository java-metadata-aggregator.

View the commit online:
http://git.shibboleth.net/view/?p=java-metadata-aggregator.git;a=commit;h=19313db5c1a0c39da484ea11e463ebc637b7793e

The following commit(s) were added to refs/heads/main by this push:
     new 19313db  JPAR-182 - Avoid use of dependencySet in assembly descriptor
19313db is described below

commit 19313db5c1a0c39da484ea11e463ebc637b7793e
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Thu Feb 10 14:37:28 2022 +0000

    JPAR-182 - Avoid use of dependencySet in assembly descriptor
    
    This drastically reduces the number of plugins that the Maven
    assembly plugin pulls in.
    
    https://shibboleth.atlassian.net/browse/JPAR-182
---
 mda-distribution/pom.xml                           | 21 +++++++++++++++++++++
 .../src/main/assembly/assembly-tgz.xml             | 22 ++++++++++------------
 .../src/main/assembly/assembly-zip.xml             | 22 ++++++++++------------
 3 files changed, 41 insertions(+), 24 deletions(-)

diff --git a/mda-distribution/pom.xml b/mda-distribution/pom.xml
index 778ebff..8fb5cb2 100644
--- a/mda-distribution/pom.xml
+++ b/mda-distribution/pom.xml
@@ -18,6 +18,7 @@
     <properties>
         <mda.finalName>mda-distribution-${project.version}</mda.finalName>
         <net.shibboleth.maven.enforcer.rules.checkM2>false</net.shibboleth.maven.enforcer.rules.checkM2>
+        <dependenciesDirectory>${project.build.directory}/dependencies</dependenciesDirectory>
     </properties>
 
     <dependencies>
@@ -60,6 +61,26 @@
 
     <build>
         <plugins>
+
+            <!-- Copy the executable's dependencies into a directory. -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${dependenciesDirectory}</outputDirectory>
+                            <includeScope>runtime</includeScope>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-assembly-plugin</artifactId>
diff --git a/mda-distribution/src/main/assembly/assembly-tgz.xml b/mda-distribution/src/main/assembly/assembly-tgz.xml
index b26de55..5015326 100644
--- a/mda-distribution/src/main/assembly/assembly-tgz.xml
+++ b/mda-distribution/src/main/assembly/assembly-tgz.xml
@@ -10,20 +10,16 @@
         <format>tar.gz</format>
     </formats>
 
-    <dependencySets>
-        <dependencySet>
+    <fileSets>
+
+        <!-- Executable and dependencies -->
+        <fileSet>
+            <directory>${dependenciesDirectory}</directory>
             <outputDirectory>lib</outputDirectory>
-            <directoryMode>774</directoryMode>
-            <fileMode>444</fileMode>
-            <scope>runtime</scope>
-            <includes>
-                <include>*:jar:*</include>
-            </includes>
-            <useProjectArtifact>false</useProjectArtifact>
-        </dependencySet>
-    </dependencySets>
+            <fileMode>0444</fileMode>
+        </fileSet>
 
-    <fileSets>
+        <!-- Unix invocation script. -->
         <fileSet>
             <outputDirectory/>
             <directory>${project.basedir}/src/script/bash</directory>
@@ -33,6 +29,8 @@
             </includes>
             <lineEnding>unix</lineEnding>
         </fileSet>
+
+        <!-- Windows invocation script. -->
         <fileSet>
             <outputDirectory/>
             <directory>${project.basedir}/src/script/bat</directory>
diff --git a/mda-distribution/src/main/assembly/assembly-zip.xml b/mda-distribution/src/main/assembly/assembly-zip.xml
index 2d1a03c..97e0d61 100644
--- a/mda-distribution/src/main/assembly/assembly-zip.xml
+++ b/mda-distribution/src/main/assembly/assembly-zip.xml
@@ -10,20 +10,16 @@
         <format>zip</format>
     </formats>
 
-    <dependencySets>
-        <dependencySet>
+    <fileSets>
+
+        <!-- Executable and dependencies -->
+        <fileSet>
+            <directory>${dependenciesDirectory}</directory>
             <outputDirectory>lib</outputDirectory>
-            <directoryMode>774</directoryMode>
-            <fileMode>444</fileMode>
-            <scope>runtime</scope>
-            <includes>
-                <include>*:jar:*</include>
-            </includes>
-            <useProjectArtifact>false</useProjectArtifact>
-        </dependencySet>
-    </dependencySets>
+            <fileMode>0444</fileMode>
+        </fileSet>
 
-    <fileSets>
+        <!-- Unix invocation script. -->
         <fileSet>
             <outputDirectory/>
             <directory>${project.basedir}/src/script/bash</directory>
@@ -33,6 +29,8 @@
             </includes>
             <lineEnding>unix</lineEnding>
         </fileSet>
+
+        <!-- Windows invocation script. -->
         <fileSet>
             <outputDirectory/>
             <directory>${project.basedir}/src/script/bat</directory>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list