3

Im using maven with tomcat7-maven plugin and its working quite well. Recently I noticed a message saying

At least one JAR was scanned for TLDs yet contained no TLDs. 
Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them.

So I did some reasearch and realised I need to set the jarsToSkip property for the jars that dont contain TLDs. I have been looking into how to find which jars it is that is causing the problem but with little luck it seams tomcat7-maven-plugin is nott passing my loggersettings that are required for output of names of the jars.

Also I do not know where I set the jarsToSkip property when I have found the jars.

Any help would be appreciated.

Pablo Jomer
  • 9,870
  • 11
  • 54
  • 102

4 Answers4

3

Believe the property jarsToSkip is a "catalina.properties" entry. Where ever your Tomcat conf folder is look at file "catalina.properties" and you should see a property like this around line 90 or so:

tomcat.util.scan.DefaultJarScanner.jarsToSkip=\

You should be able to add jars to that list to prevent them from being scanned.

As far as finding which jars are causing the issues, that would be a little more difficult to determine. Probably some trial and error work to be done there.

Durandal
  • 5,575
  • 5
  • 35
  • 49
  • I have understood that mutch but I cant find the location of the catalina.properties for the tomcat7-maven-plugin. – Pablo Jomer Jul 02 '13 at 16:59
  • 1
    $CATALINA_HOME/conf/catalina.properties should work if you're on Linux. Not sure about windows. Are you using Eclipse for this? If so you should be able to find the config files in the servers folder. – Durandal Jul 02 '13 at 20:16
  • Also if the above doesn't work you can try specifying your own directory as described in the docs: [docs](http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html#configurationDir) – Durandal Jul 02 '13 at 20:24
  • Im using eclipse and I am running on both windows and linux currently im on my windows machine. – Pablo Jomer Jul 03 '13 at 04:44
  • You should be able to find the catalina.properties file in the conf directory of the Tomcat install folder then. Check in your Eclipse server preferences where your tomcat install lives. – Durandal Jul 08 '13 at 15:34
3

When using the Tomcat 7 Maven Plugin, anything you would otherwise have put in catalina.properties can go in your plugin config. i.e.

<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.0</version>
  <configuration>
    <useTestClasspath>true</useTestClasspath>
    <path>/</path>
    <systemProperties>
      <tomcat.util.scan.DefaultJarScanner.jarsToSkip>
        myjar.jar
      </tomcat.util.scan.DefaultJarScanner.jarsToSkip>
    </systemProperties>
  </configuration>
</plugin>
Steve
  • 9,270
  • 5
  • 47
  • 61
0

There seems to be a bug with the maven tomcat plugin prior to 2.2 (ie 2.0) where the <systemProperties> don't seem to be propagated. Also in 2.2 a config option called<jarScanAllDirectories> was added which seems to improve performance even more (I think it ignores WEB-INF/classes).

Ignoring port and path I found the following configuration to greatly improve Maven Tomcat performance.

        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <port>9090</port>
                <path>/</path>
                <jarScanAllDirectories>false</jarScanAllDirectories>
                <systemProperties>
                    <org.apache.catalina.startup.ContextConfig.jarsToSkip>*.jar</org.apache.catalina.startup.ContextConfig.jarsToSkip>
                    <tomcat.util.scan.DefaultJarScanner.jarsToSkip>*.jar</tomcat.util.scan.DefaultJarScanner.jarsToSkip>
                </systemProperties>
            </configuration>
        </plugin>
Adam Gent
  • 47,843
  • 23
  • 153
  • 203
0

There is this open bug @ https://github.com/psi-probe/psi-probe/issues/348

Just pointing out.

user170008
  • 1,046
  • 6
  • 17
  • 31