I want to package only resources under directory src/main/resources
into the jar published by maven. Is there a way to do that?
To include a resource, we only need to add an <includes> element. And to exclude a resource, we only need to add an <excludes> element. For example, if we want to include all text and RTF files under our src/my-resources directory and in all its subdirectories, we can do the following: <project>
Overview. The packaging type is an important aspect of any Maven project. It specifies the type of artifact the project produces. Generally, a build produces a jar, war, pom, or other executable. Maven offers many default packaging types and also provides the flexibility to define a custom one.
Try following:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
...
</plugin>
</plugins>
...
</build>
As far as I can understand, it could be what you asked for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With