java - Declaring Extra Resource for the Apache Tomcat Maven plugin exec-war-only goal? -


i trying configure exec-war-only goal build include resources (some config files). configuration using given below

 <plugin>      <groupid>org.apache.tomcat.maven</groupid>      <artifactid>tomcat7-maven-plugin</artifactid>      <version>2.2</version>      <executions>          <execution>              <phase>package</phase>              <goals>                  <goal>exec-war-only</goal>              </goals>          </execution>      </executions>      <configuration>          <builddirectory>${project.basedir}/../kmszip/</builddirectory>          <path>/kms</path>          <finalname>${project.artifactid}.jar</finalname>          <enablenaming>true</enablenaming>          <extraresources>              <directory>${project.basedir}/</directory>              <includes>                  <include>config.json</include>              </includes>          </extraresources>      </configuration>  </plugin> 

i getting following error while building using above configuration

[error] failed execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war-only (default) on project keymanagementservice: unable parse configuration of mojo org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war-only parameter directory: cannot find default setter in class org.apache.tomcat.maven.plugin.tomcat7.run.extraresource -> [help 1]

i tried using below config <extraresources> , got similar error 1 above.

<extraresources>     <extraresource>${project.basedir}/config.json</extraresource> </extraresources> 

you missing <extraresource> tag under <extraresources>. correct configuration should be:

<plugin>     <groupid>org.apache.tomcat.maven</groupid>     <artifactid>tomcat7-maven-plugin</artifactid>     <version>2.2</version>     <executions>         <execution>             <phase>package</phase>             <goals>                 <goal>exec-war-only</goal>             </goals>         </execution>     </executions>     <configuration>         <builddirectory>${project.basedir}/../kmszip/</builddirectory>         <path>/kms</path>         <finalname>${project.artifactid}.jar</finalname>         <enablenaming>true</enablenaming>         <extraresources>             <extraresource>                 <directory>${project.basedir}/</directory>                 <includes>                     <include>config.json</include>                 </includes>             </extraresource>         </extraresources>     </configuration> </plugin> 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -