Maven META-INF files


What's inside this article ⌄
  • How to add files to meta-inf maven
  • Maven add files to meta-inf
  • Maven copy files to meta-inf
  • Maven meta-inf resources

Suppose you need to add some_dir/your_file.txt to META-INF using Maven, so that the final path looks like this:

your_app.jar/META-INF/some_dir/your_file.txt

To do this, you need to create a META-INF/some_dir folders in the src/main/resources directory, and put there your_file.txt file:

src/
main/
resources/
META-INF/
some_dir/
your_file.txt

Once compiled, Maven will move META-INF/some_dir/your_file.txt from resources to the right place without deleting the existing files in META-INF inside your jar.