Thanks, exactly what I was looking for.

-----Original Message-----
From: Thomas Broyer <t.bro...@gmail.com>
Sent: donderdag 18 februari 2021 11:44
To: jean-pierre.urk...@devoteam.com.invalid
Cc: Maven Users List <users@maven.apache.org>
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
<jean-pierre.urk...@devoteam.com.invalid> 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: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to