Export as Runnable jar bug [message #1848509] |
Mon, 06 December 2021 11:08 |
Frank Martin Messages: 6 Registered: March 2019 |
Junior Member |
|
|
When exporting a Maven project as a Runnable jar, from Eclipse, I noticed a bug.
My project has all its source code under the 'src' directory (not 'src/main/whatever').
Eclipse exports all non-Java files it finds under the 'src' folder as resources in the final JAR (which is what I want). However, when specifying the following in the pom.xml file of the project:
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</build>
Eclipse now exports all resources under a 'src' folder in the final JAR, which is not correct. The above lines should not have any effect compared to Eclipse's default JAR export behavior.
The above lines are necessary for a Maven build to take place successfully (Maven, by default, assumes resources are under 'src/main/resources' otherwise).
Long story short, because of this bug, it is not possible to write the pom.xml file so that a runnable JAR export can be done both through Eclipse and through a Maven command line.
|
|
|
Powered by
FUDForum. Page generated in 0.02751 seconds