Frage

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.

War es hilfreich?

Lösung 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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top