Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Export as Runnable jar bug
Export as Runnable jar bug [message #1848509] Mon, 06 December 2021 11:08
Frank Martin is currently offline Frank MartinFriend
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.


Previous Topic:I cannot find a background color setting
Next Topic:Run configuration
Goto Forum:
  


Current Time: Fri Apr 26 03:09:30 GMT 2024

Powered by FUDForum. Page generated in 0.02751 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top