should I exclude source folder from build path (in Eclipse)

thomas

I have some java projects that use external files as input. I usually store the files in the package directory under a folder which i name "resources". My question now is: should i exclude these folders from the build path? I though that they have to be included, but my programm still works even if they are excluded. Also the logo of the folder changes when i include/exclude the folder. Please see the attached picture. This isnt a very big issue but i was just curious. Thanks for every input on that.

eclipse package explorer example

Little Santi

Every file included in the source folders is processed:

  • Source files (.java) are compiled and the result classes are written out to the target folder (bin by default).
  • Non-source files (.properties, .txt, .xml, etc) are just copied as they are to the target folder.

Then, at execution time, only files from the target folder can be accessed by the program. Why? Because only the target folder shall be packaged into a Jar and eventually distributed. So you must not rely into the temporary circumstance that your program is reading non-source directories when executing from your IDE. Everything that shall be distributed must be into source directories.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Eclipse - exclude file / folder from triggering workspace refresh after build

From Dev

How can I exclude a folder from an Artifact Path on TeamCity?

From Dev

Maven - exclude folder from build

From Dev

Should I backup the "eclipse" folder?

From Dev

How to exclude a file/folder from Build in MonoDevelop

From Dev

Eclipse exclude php files from validation but not build

From Dev

Exclude a package from build path in POM

From Java

Should I commit the .vscode folder to source control?

From Dev

Could not exclude from source control folder from github repository

From Dev

Remove exclusion of resources folder from eclipse build?

From Dev

Build nested folder structure from path strings

From Dev

How do I only copy files to a destination that exist in the folder from the source, everything else should not be copied

From Dev

How to exclude a file\folder from SVN monitoring in Jenkins build

From Dev

Visual Studio 2015 Cordova exclude folder from build

From Dev

How to exclude a file\folder from SVN monitoring in Jenkins build

From Dev

Visual Studio 2015 Cordova exclude folder from build

From Dev

How to include/exclude source files from the project depending on the build configuration?

From Dev

Exclude an additional test source from running during build

From Dev

How to include/exclude source files from the project depending on the build configuration?

From Dev

Eclipse (CDT): include a subdirectory, exclude it from any build

From Dev

Exclude folder Intel XDK on build

From Dev

Eclipse ant build: how do I reference the current Eclipse path?

From Dev

Eclipse ant build: how do I reference the current Eclipse path?

From Dev

How can I add a short path in the build path of Eclipse?

From Dev

Eclipse source folder not recognized

From Dev

Source folder not showing in eclipse

From Java

Should I add the Visual Studio 2015 .vs folder to source control?

From Dev

How can I programmatically set a source folder in Eclipse?

From Dev

Should I compile a library from source?

Related Related

  1. 1

    Eclipse - exclude file / folder from triggering workspace refresh after build

  2. 2

    How can I exclude a folder from an Artifact Path on TeamCity?

  3. 3

    Maven - exclude folder from build

  4. 4

    Should I backup the "eclipse" folder?

  5. 5

    How to exclude a file/folder from Build in MonoDevelop

  6. 6

    Eclipse exclude php files from validation but not build

  7. 7

    Exclude a package from build path in POM

  8. 8

    Should I commit the .vscode folder to source control?

  9. 9

    Could not exclude from source control folder from github repository

  10. 10

    Remove exclusion of resources folder from eclipse build?

  11. 11

    Build nested folder structure from path strings

  12. 12

    How do I only copy files to a destination that exist in the folder from the source, everything else should not be copied

  13. 13

    How to exclude a file\folder from SVN monitoring in Jenkins build

  14. 14

    Visual Studio 2015 Cordova exclude folder from build

  15. 15

    How to exclude a file\folder from SVN monitoring in Jenkins build

  16. 16

    Visual Studio 2015 Cordova exclude folder from build

  17. 17

    How to include/exclude source files from the project depending on the build configuration?

  18. 18

    Exclude an additional test source from running during build

  19. 19

    How to include/exclude source files from the project depending on the build configuration?

  20. 20

    Eclipse (CDT): include a subdirectory, exclude it from any build

  21. 21

    Exclude folder Intel XDK on build

  22. 22

    Eclipse ant build: how do I reference the current Eclipse path?

  23. 23

    Eclipse ant build: how do I reference the current Eclipse path?

  24. 24

    How can I add a short path in the build path of Eclipse?

  25. 25

    Eclipse source folder not recognized

  26. 26

    Source folder not showing in eclipse

  27. 27

    Should I add the Visual Studio 2015 .vs folder to source control?

  28. 28

    How can I programmatically set a source folder in Eclipse?

  29. 29

    Should I compile a library from source?

HotTag

Archive