Created
May 25, 2017 09:48
-
-
Save buckett/8d409f3ff483e276414f139423886731 to your computer and use it in GitHub Desktop.
Looks for TLD files inside JAR files for Tomcat jar scanning configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This attempts to look in all the jar files for any tag library description files (tlds). | |
# This is useful because to speed up tomcat startup you can stop if scanning everything | |
# and then add back in the files that are needed. | |
# This needs to be run on a tomcat folder that has unpacked wars as it won't find JARs inside | |
# WARs. | |
# It outputs the pattern to put in the `tldScan` attribute of the JAR scanner | |
# http://tomcat.apache.org/tomcat-8.5-doc/config/jar-scan-filter.html | |
( find . -name \*.jar | while read file; do | |
if unzip -l $file | grep -q 'META-INF/.*\.tld'; then | |
basename $file | |
fi | |
done ) | sed -E 's/([0-9]+[\._-]?)+(RELEASE|SNAPSHOT)?/*/;s/\*jar/*.jar/' | sort | uniq | paste -sd ',' - | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment