I would like to know if there is a good way to build JAR files with Maven and after that copy them into %TOMCAT%/lib
folder.
What I want to achieve is that every time when I deploy my WAR in the cloud (using Jenkins and Cloud Foundry), I get all JARs needed by Tomcat copied in its lib folder.
My use case is, my application uses Redis to store sessions (to be cloud ready), and I have added this configuration to %TOMCAT%/context.xml
file
<!-- session persistence is handled by Redis Data Server -->
<Valve className="com.gopivotal.manager.SessionFlushValve" />
<Manager className="org.apache.catalina.session.PersistentManager"
host="localhost"
port="6379"
database="0"
maxInactiveInterval="60">
<Store className="com.gopivotal.manager.redis.RedisStore" />
</Manager>
Sessions are stored like a charm when I copy manually redis.jar
, commons-pool.jar
and jedis.jar
in %TOMCAT%/lib
, but I want to do that automatically based on the best practice.