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
Post a Comment