Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove exclusion of resources folder from eclipse build?

I imported my existing maven projects under eclipse.Once imported i found under Java Build Path > Source resource foulder is excluded(i can see Excluded:**) from build and does not get copied under target > classes directory.

I can remove exclusion manually by selecting Excluded:** and then click Remove, But there are large numbers of projects. Is there a setting in eclipse where i can do it one go ?

like image 744
emilly Avatar asked Nov 01 '22 11:11

emilly


1 Answers

That's part of what Maven does when you let it generate your Eclipse project settings (via the eclipse:eclipse plugin/goal). It's quite misleading. However, if you have the m2e plugins installed into Eclipse it coordinates things correctly.

What's going on, as best as I can figure: Eclipse's built-in Java builder automatically copies non-Java files found on the build path to the output location (unless they're excluded as you see in your Build Path). Problem is, when Maven comes in the picture it, too, wants to copy resources during a build. So to keep the two builders from competing/interfering with each other, Maven instructs Eclipse to ignore resources so it (Maven) can manage copying them during a build.

m2e integrates into the Eclipse build process to do the Maven copying of those files, so if you configure the project as an m2e project things will "just work," both in Eclipse and if you build from a command line.

I don't know of a way to tell Maven to not configure the project this way. To be honest, that's just one of the reasons I prefer to not let Maven generate my Eclipse project files; I do a much better job of it and I totally control the specifics rather than relying on whatever the Maven eclipse developers think is best.

like image 98
E-Riz Avatar answered Nov 15 '22 04:11

E-Riz