简体   繁体   中英

Where should i get context.xml for tomcat7-maven-plugin

When i run embedded tomcat with the help of tomcat7-maven-plugin it crashes with following error:

SEVERE: Missing context.xml

I have following configuration in maven plugin:

                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat7-maven-plugin</artifactId>
                        <version>2.0</version>
                        <configuration>
                            <path>/project_name_test</path>
                        </configuration>
                        <executions>
                            <execution>
                                <id>tomcat-run</id>
                                <goals>
                                    <goal>run-war-only</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <fork>true</fork>
                                </configuration>
                            </execution>
                            <execution>
                                <id>tomcat-shutdown</id>
                                <goals>
                                    <goal>shutdown</goal>
                                </goals>
                                <phase>post-integration-test</phase>
                            </execution>
                        </executions>
                    </plugin>

Do we have an option for default context? I don't want to create any context - i have war file which will be uploaded into this application server.

EDIT:

I found the issue. In order to ingore context.xml you should add attribute with parameters you need. For example :

                        <configuration>
                            <url>http://localhost:8080/manager</url>
                            <server>localhost</server>
                            <path>/${project.build.finalName}</path>
                        </configuration>

Can you try just this first:

<plugins>
   <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      <version>2.2</version>
   </plugin>
</plugins>

If you need a context.xml file it should go under META-INF folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM