developer_tt
developer_tt

Reputation: 11

Maven create jar out of folder

Hi i would like to do a simple task within a maven build. This task should go to a specific folder and should pack the contain of the folder into a jar file. (just like zip everything into jar)

How can i do that

Upvotes: 0

Views: 32

Answers (1)

S. Pauk
S. Pauk

Reputation: 5318

You should make use of Apache Maven Assembly Plugin.

You could specify the source directory in assembly descriptor as follows:

<fileSets>
    <fileSet>
        <directory>[source directory path]</directory>
    </fileSet>
</fileSets>

and pack it as a jar:

<formats>
    <format>jar</format>
</formats>

Upvotes: 1

Related Questions