Peter Johnson wrote:You don't want to do this.
First, servlets must reside in the WEB-INF/lib directory. (Well, let me say I've never heard of them being outside of it.)
Second, WARs are not transparent, any classes residing in JARs outside of the WAR will not have visibility to classes inside the WAR. This can lead to class not found exceptions.
If you have some utility classes that you are sure won't need to call back into classes in the WAR, you can do it this way: you will need 2 projects, one to build the WAR, the other to build the EAR.
The POM for the WAR should indicate the "provided" scope for all of the dependencies that go into the EAR/lib directory. This way the compile can use them to compile your servlets, yet won't package them into the WEB-INF/lib directory.
The POM for the EAP would list the the JARs that go into EAR/lib as dependencies.
(That is sort of off the top of my head, I haven't tried it before and rarely build EARs)
Peter Johnson wrote:You don't want to do this.
First, servlets must reside in the WEB-INF/lib directory. (Well, let me say I've never heard of them being outside of it.)
Second, WARs are not transparent, any classes residing in JARs outside of the WAR will not have visibility to classes inside the WAR. This can lead to class not found exceptions.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
When i tried to mavenize the project, maven put these dependent projects as jars into the WEB-INF/lib folder
Don't get me started about those stupid light bulbs. |