Required steps for those executing gradle builds on trunk

LabKey Support Forum (Inactive)
Required steps for those executing gradle builds on trunk adam  2017-06-07 21:03
Status: Closed
 
If you've executed any LabKey gradle builds on your development machine then you need to perform some simple, but important, steps to ensure you don't end up with multiple copies of key JAR files in your <tomcat>/lib directory.

Tomcat requires all classes referenced by labkey.xml to be on its own classpath, so standard practice is to copy JDBC drivers, javax.mail.jar, bootstrap classloader JARs, etc. into <tomcat>/lib. For many years, LabKey has distributed "unversioned" copies of the JAR files it requires to provide a straightforward upgrade process.

When first released, our gradle build switched to deploying versioned copies of JAR files into <tomcat>/lib (e.g., jtds-1.3.1.jar instead of jtds.jar). Yesterday, we changed gradlePlugins to deploy unversioned files, matching our previous approach.

If you've built with gradle then you must remove the versioned files from your <tomcat>/lib directory, otherwise you'll end up with multiple copies of these JARs (which will lead to problems). Follow these steps:

  • Delete six versioned JAR files from your <tomcat>/lib directory. You can delete them manually or execute gradlew cleanTomcatLib. (Another option is to download the latest Tomcat release, install it, and update CATALINA_HOME.) These files (or similarly named ones) need to be removed:
    • ant-1.7.0.jar
    • javax.mail-1.5.5.jar
    • jtds-1.3.1.jar
    • labkeyBootstrap-17.2-SNAPSHOT.jar
    • mysql-connector-java-5.1.39.jar
    • postgresql-42.0.0.jar
  • Delete all files in your /build/staging/tomcat-lib directory.
  • Copy the unversioned JAR files into <tomcat>/lib by executing gradlew setup.
Your <tomcat>/lib directory should now contain the files below (plus many of Tomcat's own JAR files), but none of the versioned files mentioned above:
  • mail.jar
  • jtds.jar
  • labkeyBoostrap.jar
  • mysql.jar
  • postgresql.jar
Note that ant.jar is no longer copied, because we eliminated that dependency last week. See issue 30479.

Please respond if you have any questions or problems.

Adam