문제

I have a custom classloader jar <scope>provided</scope> that must be in tomcat/lib before my webapp is run or else it fails to start. I'm using WTP. Is there some way that I can configure M2E/WTP to automatically copy this custom jar to tomcat/lib during the deploy process?

Edit:

It doesn't have to be using WTP, I could also use, for example, a solution using tomcat6-maven-plugin.

도움이 되었습니까?

해결책 2

I spent a lot of time researching this problem and here's what I've found:

The tomcat6-maven-plugin does not properly emulate the tomcat boot order, as seen in this jira issue as well as their tomcat6-maven-plugin source.

However, after more research I discovered another maven plugin that I didn't know existed: cargo. Thanks to their excellent documentation I was able to get my project running with the custom (and picky) class loader jar.

다른 팁

For running an embedded Tomcat instance with the Tomcat Maven plugin, add the JARs required in the Tomcat lib dir as dependencies of the Tomcat plugin itself as shown in this example with the derby and javamail dependencies.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top