Wednesday, September 08, 2010

Bug in Helios - J2EE Module dependencies KAPUT!

Those idiots in charge of Eclipse WTP have done it again.

Apparently they have removed the J2EE module dependencies feature in Eclipse 3.6 Helios WTP 3.2.0
What this means that if you have user libraries which your project will depend on (like.. say... JSTL or JDBC or something like that) normally under the old Galileo version you would:

1. Add a user library (or external jar or whatever) to the Java build path (Libraries -> Add External Jars).
2. Modify the J2EE Module Dependencies to export this (so it will get copied into the WEB-INF/lib directory or / depending on whether it's a WAR, JAR or EAR project)

Helios way:
They removed J2EE module dependencies, and now have a new feature called "Deployment Assembly" - which by itself looks interesting (directly map the source paths to deployment paths - this is goodness indeed). However, it forgets completely about the Java build path - ahem folks, how the F^*(^ do you mark the libraries to be exported to WEB-INF/lib ?? ooops... bbzzztt... epic fail.


Effectively, the missing libraries will appear due to the "Classpath dependency validator" which will indicate which libraries will be missing from the Webapp. You then select each miscreant and press QuickFix (Ctrl-1) to fix - ie: "Mark the associated raw classpath entry as a publish/export dependency"
(or the negative case: Exclude the associated raw classpath entry from the set of potential publish/export dependencies")

From what I gather, this is the ONLY way to do this until this bug is fixed.

The referenced bug may be fixed in Helios SR1: https://bugs.eclipse.org/bugs/show_bug.cgi?id=306462

Pain.

UPDATE: New way around this stupidity
Choose Deployment Assembly:
Click Add > Classpath Container > User Library > whatever
Now it will work. Geez!!


3 comments:

wongcr said...

Update: Seems there is a workaround:
http://www.eclipse.org/forums/index.php?t=msg&th=172980&start=0&S=8e1b1230ca41777f3688d6396d0a2c58

Unknown said...

Thank you! Been banging my head against this for hours. The QuickFix method solved it for me.

Unknown said...

Thank you! I'd been banging my head against this for a couple of hours. The QuickFix method solved it for me.