Search code examples
javamavenjarmeta-inf

How to add folder and files inside the META-INF folder of maven generated jar file


I want to add few files in a particular directory structure in generated MET-INF folder. I am using maven.

abc.jar
  |-META-INF
  |    |-bind
  |        |-obj.map 
  |-BOOT-INF
  |-org 

mvn and jdk versions are as shown below

maven home: C:\tools\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin\..
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: C:\jdk1.8.0_181\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

My project structure is as follows:

ABC
|--src
|   |-main
|   |   |-java
|   |   |-resources  
|   | 
|   |-test
|--pom.xml


Solution

  • finally figured it out.

    I created the required directory structure as shown below, Created a bin folder and created obj.map file inside it.

    ABC
    |--src
    |   |-main
    |   |   |-java
    |   |   |-resources  
    |   |        |-bind
    |   |          |-obj.map 
    |   |-test
    |--pom.xml