开发者

Exclude source directories from deployment to EAR/EJB module using Eclipse?

开发者 https://www.devze.com 2023-01-29 06:00 出处:网络
I have an EAR project with an EJB module. In the EJB module I have a source directory called /test. I don\'t want this particular directory to be included in the ejb archive inside the ear that gets d

I have an EAR project with an EJB module. In the EJB module I have a source directory called /test. I don't want this particular directory to be included in the ejb archive inside the ear that gets deployed.

I'm using Eclipse Helios and JBoss tools. My deployment server is 开发者_JAVA技巧JBoss AS 5.1.

I tried to remove this /test source directory from the "Deployment Assembly" page in Eclipse, but that seems to have no effect.


You were half of the way when you removed the /test source directory from the "Deployment Assembly" page.

What you need to realize is that this does not actually remove the SOURCE DIRECTORY from the deployment, but the OUTPUT FOLDER associated with that source directory.

By default, all source directories share the same output folder. If you remove one source directory from the deployment assembly in this situation, you still get its classes since another source directory outputs to the same output folder and Eclipse copies over the complete output folder, completely disregarding which source folder contributed which classes.

The solution is to associate an independent output folder which each source directory that you want to exclude.


Try the trick provided here: http://blog.projectnibble.org/2009/08/24/excluding-test-classes-from-war-ear/


The link from this other reply doesn't work (today).
But following Arjan Tijms reply, how to...

... associate an independent output folder which each source directory that you want to exclude.

? Solution here :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号