简体   繁体   中英

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

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 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.

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM