Logging configuration for the Apache Tomcat Maven plugin exec-war-only goal?

I would like to specify a logging configuration file via the extraResources tag described @ http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/exec-war-only-mojo.html#extraResources and am getting the following maven error

Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:exec-war-only (tomcat-run) on project iot-service-embedded-tomcat: Unable to parse configuration of mojo org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:exec-war-only for parameter extraResource: Cannot configure instance of org.apache.tomcat.maven.plugin.tomcat7.run.ExtraResource from log4j.properties

Here's the maven plugin entry:

<plugin>
   <groupId>org.apache.tomcat.maven</groupId>
   <artifactId>tomcat7-maven-plugin</artifactId>
   <version>2.1</version>
   <executions>
      <execution>
         <id>tomcat-run</id>
         <goals>
            <goal>exec-war-only</goal>
         </goals>
         <phase>package</phase>
         <configuration>
            ...
            <extraResources>
               <extraResource>
                  log4j.properties
               </extraResource>
            </extraResources>
            <extraDependencies>
               ...
               <extraDependency>
                  <groupId>log4j</groupId>
                  <artifactId>log4j</artifactId>
                  <version>1.2.17</version>
                  <scope>compile</scope>
               </extraDependency>
            </extraDependencies>
            ...
         </configuration>
      </execution>
   </executions>
</plugin>

What is the proper syntax?

Answers


I was able to find the answer by looking at the the getters/setters in the Maven model Resource class. The proper syntax is:

<extraResources>
   <extraResource>
      <directory>path/to/resource/</directory>
      <includes>
         <include>resource.file.name</include>
      </includes>
   </extraResource>
</extraResources>

Need Your Help

Writing unicode characters with Batik doesn't work

java unicode batik

I am writing a project with Batik, which is for multi-language image. Therefore I need signs like "sigma" or "alpha". I have to write the character as text - not as a polygon or as a glyph - becaus...

Programming Skill Tester (Problem) v2.0

c# winforms

If you haven't read the first problem do so know to catch up to speed. Now then, how do I go about clearing these check boxes? I tried using the same approach that @colithium told me to use for che...