Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/397.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java tomcat maven插件忽略自定义web.xml和context.xml_Java_Maven_Tomcat_Maven Plugin_Maven Tomcat Plugin - Fatal编程技术网

Java tomcat maven插件忽略自定义web.xml和context.xml

Java tomcat maven插件忽略自定义web.xml和context.xml,java,maven,tomcat,maven-plugin,maven-tomcat-plugin,Java,Maven,Tomcat,Maven Plugin,Maven Tomcat Plugin,我正试图为war测试一个带有自定义“finalName”的web项目,但是当我执行mvn tomcat7:runtomcat时会忽略自定义文件web.xml和context.xml 默认的context.xml文件不是由嵌入式tomcat加载的 这是pom.xml中的插件配置: <plugin> <groupId>org.apache.tomcat.maven</groupId> <arti

我正试图为war测试一个带有自定义“finalName”的web项目,但是当我执行
mvn tomcat7:run
tomcat时会忽略自定义文件web.xml和context.xml

默认的
context.xml
文件不是由嵌入式tomcat加载的

这是pom.xml中的插件配置:

        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <charset>UTF-8</charset>
                <mode>context</mode>
                <!-- naming is disabled by default so use true to enable it -->
                <enableNaming>true</enableNaming> <!-- tomcat6 -->
                <useNaming>true</useNaming> <!-- tomcat7 -->
                <contextFile>${project.basedir}/src/tomcat7-maven-plugin/resources/project.xml</contextFile>
                <tomcatWebXml>${project.basedir}/src/tomcat7-maven-plugin/resources/web.xml</tomcatWebXml>
                <contextReloadable>true</contextReloadable>
                <!--  <path>/${project.build.finalName}</path> -->
                <port>${tomcat.webport}</port>
                <ajpPort>${tomcat.ajpport}</ajpPort>
                <systemProperties>
                    <JAVA_OPTS>-XX:MaxPermSize=256m</JAVA_OPTS>
                </systemProperties>
                <extraDependencies> <!-- tomcat 7 -->
                    <dependency>
                        <groupId>com.microsoft.sqlserver</groupId>
                        <artifactId>sqljdbc42</artifactId>
                        <version>4.2.6420.100</version>
                        <scope>runtime</scope>
                    </dependency>
                </extraDependencies>
            </configuration>
            <dependencies> <!-- tomcat 6  -->
                <dependency>
                    <groupId>com.microsoft.sqlserver</groupId>
                    <artifactId>sqljdbc42</artifactId>
                    <version>4.2.6420.100</version>
                </dependency>
            </dependencies>
        </plugin>
我看了文档,没有发现任何错误

[DEBUG] Configuring mojo 'org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run' with basic configurator -->
[DEBUG]   (f) addContextWarDependencies = false
[DEBUG]   (f) addWarDependenciesInClassloader = true
[DEBUG]   (f) additionalConfigFilesDir = C:\Users\test\Documents\wp-eclipse-kepler\project\src\main\tomcatconf
[DEBUG]   (f) ajpPort = 0
[DEBUG]   (f) ajpProtocol = org.apache.coyote.ajp.AjpProtocol
[DEBUG]   (f) backgroundProcessorDelay = -1
[DEBUG]   (f) clientAuth = false
[DEBUG]   (f) configurationDir = C:\Users\test\Documents\wp-eclipse-kepler\project\target\tomcat
[DEBUG]   (f) contextFile = C:\Users\test\Documents\wp-eclipse-kepler\project\src\tomcat7-maven-plugin\resources\project.xml
[DEBUG]   (f) contextReloadable = true
[DEBUG]   (f) defaultContextFile = C:\Users\test\Documents\wp-eclipse-kepler\project\target\project\META-INF\context.xml
[DEBUG]   (f) delegate = true
[DEBUG]   (f) port = 8080
[DEBUG]   (f) protocol = HTTP/1.1
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@3a7c678b
[DEBUG]   (f) skip = false
[DEBUG]   (f) staticContextPath = /
[DEBUG]   (f) systemProperties = {JAVA_OPTS=-XX:MaxPermSize=256m}
[DEBUG]   (f) tomcatWebXml = C:\Users\test\Documents\wp-eclipse-kepler\project\src\tomcat7-maven-plugin\resources\web.xml
[DEBUG]   (f) uriEncoding = ISO-8859-1
[DEBUG]   (f) useBodyEncodingForURI = false
[DEBUG]   (f) useNaming = true
[DEBUG]   (f) useSeparateTomcatClassLoader = false
[DEBUG]   (f) useTestClasspath = false
[DEBUG]   (f) warSourceDirectory = C:\Users\test\Documents\wp-eclipse-kepler\project\src\main\webapp
[DEBUG]   (f) project = MavenProject: com.abb.csis.app:project:1.6.4-rc2 @ C:\Users\test\Documents\wp-eclipse-kepler\projecte\pom.xml
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@18c04885