maven-assembly-plugin v3.3.0 - how to modify generated MANIFEST.MF

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

maven-assembly-plugin v3.3.0 - how to modify generated MANIFEST.MF

Jean-Pierre Urkens
Hi all,



I am trying to generate a ‘jar’ assembly that contains a ‘Main-Class’ in
the META-INF/MANIFEST.MF. Now it looks like the assembly plugin is
generating its own (plexus archiver) MANIFEST file with contents:

               Manifest-Version: 1.0

Created-By: Plexus Archiver 4.2.1



My idea was to include via a <fileSet> my own MANIFEST.MF file specifying
the Main-Class and ‘append’ this to the generated MANIFEST using the
‘file-aggregator’ containerDescriptorHandler in my descriptor file:



      <containerDescriptorHandlers>

            <containerDescriptorHandler>

                  <handlerName>file-aggregator</handlerName>

                  <configuration>

                        <filePattern>.*/MANIFEST.MF</filePattern>

                        <outputPath>META-INF/MANIFEST.MF</outputPath>

                  </configuration>

            </containerDescriptorHandler>

      </containerDescriptorHandlers>



This didn’t work so I was wondering whether it found my manifest file. So I
adjusted the above configuration to write to ‘<outputPath>test/
META-INF/MANIFEST.MF</outputPath>’.

My own manifest file resides under ‘db/MANIFEST.MF’ and should be picked up
by:



      <fileSets>

            <fileSet>

                  <directory>${project.build.directory}/classes</directory>

                  <outputDirectory></outputDirectory>

                  <useDefaultExcludes>false</useDefaultExcludes>

                  <includes>

                        <include>db/**</include>

                  </includes>

            </fileSet>

      </fileSets>



Now it does generate an ‘test/META-INF/MANIFEST.MF’ but with following
contents:

               # Aggregated on Thu Feb 18 11:18:39 CET 2021 from:



So it looks that the content of my ‘db/MANIFEST.MF’ isn’t included. What am
I missing? How can I add my own content to the generated manifest file of
this plugin?



Tanks for any hints,



J.P.
Reply | Threaded
Open this post in threaded view
|

Re: maven-assembly-plugin v3.3.0 - how to modify generated MANIFEST.MF

Thomas Broyer-2
Use the 'archive' property of the assembly plugin itself (not in the
assembly descriptor):
http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#archive

Le jeu. 18 févr. 2021 à 11:23, Jean-Pierre Urkens
<[hidden email]> a écrit :

> Hi all,
>
>
>
> I am trying to generate a ‘jar’ assembly that contains a ‘Main-Class’ in
> the META-INF/MANIFEST.MF. Now it looks like the assembly plugin is
> generating its own (plexus archiver) MANIFEST file with contents:
>
>                Manifest-Version: 1.0
>
> Created-By: Plexus Archiver 4.2.1
>
>
>
> My idea was to include via a <fileSet> my own MANIFEST.MF file specifying
> the Main-Class and ‘append’ this to the generated MANIFEST using the
> ‘file-aggregator’ containerDescriptorHandler in my descriptor file:
>
>
>
>       <containerDescriptorHandlers>
>
>             <containerDescriptorHandler>
>
>                   <handlerName>file-aggregator</handlerName>
>
>                   <configuration>
>
>                         <filePattern>.*/MANIFEST.MF</filePattern>
>
>                         <outputPath>META-INF/MANIFEST.MF</outputPath>
>
>                   </configuration>
>
>             </containerDescriptorHandler>
>
>       </containerDescriptorHandlers>
>
>
>
> This didn’t work so I was wondering whether it found my manifest file. So I
> adjusted the above configuration to write to ‘<outputPath>test/
> META-INF/MANIFEST.MF</outputPath>’.
>
> My own manifest file resides under ‘db/MANIFEST.MF’ and should be picked up
> by:
>
>
>
>       <fileSets>
>
>             <fileSet>
>
>                   <directory>${project.build.directory}/classes</directory>
>
>                   <outputDirectory></outputDirectory>
>
>                   <useDefaultExcludes>false</useDefaultExcludes>
>
>                   <includes>
>
>                         <include>db/**</include>
>
>                   </includes>
>
>             </fileSet>
>
>       </fileSets>
>
>
>
> Now it does generate an ‘test/META-INF/MANIFEST.MF’ but with following
> contents:
>
>                # Aggregated on Thu Feb 18 11:18:39 CET 2021 from:
>
>
>
> So it looks that the content of my ‘db/MANIFEST.MF’ isn’t included. What am
> I missing? How can I add my own content to the generated manifest file of
> this plugin?
>
>
>
> Tanks for any hints,
>
>
>
> J.P.
>
Reply | Threaded
Open this post in threaded view
|

RE: maven-assembly-plugin v3.3.0 - how to modify generated MANIFEST.MF

Jean-Pierre Urkens
Thanks, exactly what I was looking for.

-----Original Message-----
From: Thomas Broyer <[hidden email]>
Sent: donderdag 18 februari 2021 11:44
To: [hidden email]
Cc: Maven Users List <[hidden email]>
Subject: Re: maven-assembly-plugin v3.3.0 - how to modify generated
MANIFEST.MF

Use the 'archive' property of the assembly plugin itself (not in the
assembly descriptor):
http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#archive

Le jeu. 18 févr. 2021 à 11:23, Jean-Pierre Urkens
<[hidden email]> a écrit :

> Hi all,
>
>
>
> I am trying to generate a ‘jar’ assembly that contains a ‘Main-Class’
> in the META-INF/MANIFEST.MF. Now it looks like the assembly plugin is
> generating its own (plexus archiver) MANIFEST file with contents:
>
>                Manifest-Version: 1.0
>
> Created-By: Plexus Archiver 4.2.1
>
>
>
> My idea was to include via a <fileSet> my own MANIFEST.MF file
> specifying the Main-Class and ‘append’ this to the generated MANIFEST
> using the ‘file-aggregator’ containerDescriptorHandler in my descriptor
> file:
>
>
>
>       <containerDescriptorHandlers>
>
>             <containerDescriptorHandler>
>
>                   <handlerName>file-aggregator</handlerName>
>
>                   <configuration>
>
>                         <filePattern>.*/MANIFEST.MF</filePattern>
>
>                         <outputPath>META-INF/MANIFEST.MF</outputPath>
>
>                   </configuration>
>
>             </containerDescriptorHandler>
>
>       </containerDescriptorHandlers>
>
>
>
> This didn’t work so I was wondering whether it found my manifest file.
> So I adjusted the above configuration to write to ‘<outputPath>test/
> META-INF/MANIFEST.MF</outputPath>’.
>
> My own manifest file resides under ‘db/MANIFEST.MF’ and should be
> picked up
> by:
>
>
>
>       <fileSets>
>
>             <fileSet>
>
>
> <directory>${project.build.directory}/classes</directory>
>
>                   <outputDirectory></outputDirectory>
>
>                   <useDefaultExcludes>false</useDefaultExcludes>
>
>                   <includes>
>
>                         <include>db/**</include>
>
>                   </includes>
>
>             </fileSet>
>
>       </fileSets>
>
>
>
> Now it does generate an ‘test/META-INF/MANIFEST.MF’ but with following
> contents:
>
>                # Aggregated on Thu Feb 18 11:18:39 CET 2021 from:
>
>
>
> So it looks that the content of my ‘db/MANIFEST.MF’ isn’t included.
> What am I missing? How can I add my own content to the generated
> manifest file of this plugin?
>
>
>
> Tanks for any hints,
>
>
>
> J.P.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]