Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Classpath attribute in manifest.mf when using spring boot maven plugin to build jar

Tags:

spring-boot

I am using spring boot maven plugin.I need to add class-path attribute in the manifest.mf file generated.This class-path entry should contain all jar files present in lib folder of the fat jar file created by spring boot.How is this possible?

like image 236
Arghya Sadhu Avatar asked Oct 20 '22 17:10

Arghya Sadhu


1 Answers

there is simple solution

Only what you need it is add

maven-war-plugin

or

maven-jar-plugin

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
        <archive>
            <manifest>
                <addClasspath>true</addClasspath>
            </manifest>
            <manifestEntries>
                <mode>development</mode>
                <url>http://sample.com</url>
                <key>value</key>
            </manifestEntries>
        </archive>
    </configuration>
</plugin>

And put your additional values in manifestEntries .

Regards Aleksandar

like image 125
abosancic Avatar answered Nov 15 '22 10:11

abosancic