Search code examples
mavenmaven-3packaging

How to avoid creating empty jar in non-Java Maven project?


I have a Maven project which uses a jdeb plugin to generate a deb (Ubuntu installer) package with some simple shell scripts that I would like to send to a customer to be able to deploy easily. This project has no Java whatsoever. I am not specifying in the pom.xml that it should package a jar. However, an empty jar does get packaged in the project's target directory anyway.

How can I avoid creating this empty jar file? I am not sure if it gets included in the deb package but if it does, it is just dead weight size-wise.


Solution

  • Got it figured. In the pom.xml the following needs to be added at the same hierarchy level where the <name>...</name> is for that project:

    <packaging>pom</packaging>
    

    Otherwise

    <packaging>jar</packaging>
    

    is assumed as a default.