You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/09/02 19:22:19 UTC
svn commit: r1759019 - in /tomcat/trunk:
java/org/apache/tomcat/util/scan/StandardJarScanner.java
webapps/docs/changelog.xml webapps/docs/config/jar-scanner.xml
Author: markt
Date: Fri Sep 2 19:22:19 2016
New Revision: 1759019
URL: http://svn.apache.org/viewvc?rev=1759019&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59961
Add an option to the StandardJarScanner to control whether or not JAR Manifests are scanned for additional class path entries.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
tomcat/trunk/webapps/docs/changelog.xml
tomcat/trunk/webapps/docs/config/jar-scanner.xml
Modified: tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java?rev=1759019&r1=1759018&r2=1759019&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java Fri Sep 2 19:22:19 2016
@@ -94,6 +94,17 @@ public class StandardJarScanner implemen
}
/**
+ * Controls the JAR file Manifest scanning extension.
+ */
+ private boolean scanManifest = true;
+ public boolean isScanManifest() {
+ return scanManifest;
+ }
+ public void setScanManifest(boolean scanManifest) {
+ this.scanManifest = scanManifest;
+ }
+
+ /**
* Controls the testing all files to see of they are JAR files extension.
*/
private boolean scanAllFiles = false;
@@ -325,7 +336,9 @@ public class StandardJarScanner implemen
if ("jar".equals(url.getProtocol()) || url.getPath().endsWith(Constants.JAR_EXT)) {
try (Jar jar = JarFactory.newInstance(url)) {
- processManifest(jar, isWebapp, classPathUrlsToProcess);
+ if (isScanManifest()) {
+ processManifest(jar, isWebapp, classPathUrlsToProcess);
+ }
callback.scan(jar, webappPath, isWebapp);
}
} else if ("file".equals(url.getProtocol())) {
@@ -336,7 +349,9 @@ public class StandardJarScanner implemen
// Treat this file as a JAR
URL jarURL = UriUtil.buildJarUrl(f);
try (Jar jar = JarFactory.newInstance(jarURL)) {
- processManifest(jar, isWebapp, classPathUrlsToProcess);
+ if (isScanManifest()) {
+ processManifest(jar, isWebapp, classPathUrlsToProcess);
+ }
callback.scan(jar, webappPath, isWebapp);
}
} else if (f.isDirectory()) {
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1759019&r1=1759018&r2=1759019&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Fri Sep 2 19:22:19 2016
@@ -45,6 +45,15 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 9.0.0.M11" rtext="in development">
+ <subsection name="Catalina">
+ <changelog>
+ <add>
+ <bug>59961</bug>: Add an option to the <code>StandardJarScanner</code>
+ to control whether or not JAR Manifests are scanned for additional
+ class path entries. (markt)
+ </add>
+ </changelog>
+ </subsection>
<subsection name="Other">
<changelog>
<fix>
Modified: tomcat/trunk/webapps/docs/config/jar-scanner.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/jar-scanner.xml?rev=1759019&r1=1759018&r2=1759019&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/jar-scanner.xml (original)
+++ tomcat/trunk/webapps/docs/config/jar-scanner.xml Fri Sep 2 19:22:19 2016
@@ -117,6 +117,12 @@
files. The default is <code>false</code>.</p>
</attribute>
+ <attribute name="scanManifest" required="false">
+ <p>If <code>true</code>, the Manifest files of any JARs found will be
+ scanned for additional class path entires and those entries will be added
+ to the URLs to scan. The default is <code>true</code>.</p>
+ </attribute>
+
</attributes>
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org