我有一个 Spring-Maven 项目,我配置了 Java 类,没有 web.xml。当我使用“mvn jetty:run”部署它时,出现此错误“ web.xml 在位置 ../src/main/webapp/WEB-INF/web.xml 不存在”。
这是我在 pom.xml 中定义的插件。
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>6.1.10</version>
            <configuration>
                <scanIntervalSeconds>10</scanIntervalSeconds>
                <stopKey>foo</stopKey>
                <stopPort>9999</stopPort>
            </configuration>
            <executions>
                <execution>
                    <id>start-jetty</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <daemon>true</daemon>
                    </configuration>
                </execution>
                <execution>
                    <id>stop-jetty</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
正如我从 Jetty 文档中阅读的那样,我们可以在jetty:run目标配置中定义 web.xml 位置。我们是否也可以对此进行配置,以便 Jetty 使用我的 WebConfig 类作为 web.xml?