首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jetty 9 Maven插件未正确设置defaultsDescriptor

Jetty 9 Maven插件未正确设置defaultsDescriptor
EN

Stack Overflow用户
提问于 2014-05-01 01:43:31
回答 1查看 2.3K关注 0票数 2

我目前正在使用Maven插件运行Jetty 9,其定义如下:

pom.xml

代码语言:javascript
复制
<properties>
  <jetty.version>9.1.3.v20140225</jetty.version>
</properties>

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-maven-plugin</artifactId>
      <version>${jetty.version}</version>
      <dependencies>
        <dependency>
          <groupId>org.ow2.asm</groupId>
          <artifactId>asm</artifactId>
          <version>${asm.version}</version>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</pluginManagement>

网站项目pom.xml

代码语言:javascript
复制
<plugins>
  <plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <configuration>
      <httpConnector>
        <port>8888</port>
        <idleTimeout>60000</idleTimeout>
      </httpConnector>
      <scanIntervalSeconds>10</scanIntervalSeconds>
      <stopKey>StopTouchingMe</stopKey>
      <stopPort>8889</stopPort>
      <systemProperties>
        <systemProperty>
          <name>com.pearson.platformj.server.root</name>
          <value>${project.basedir}/target</value>
        </systemProperty>
      </systemProperties>
      <webApp>
        <contextPath>/</contextPath>
      </webApp>
      <webAppConfig>
        <defaultsDescriptor>src/main/resources/webdefault.xml</defaultsDescriptor>
      </webAppConfig>
    </configuration>
  </plugin>
</plugins>

我需要覆盖默认的webdefault.xml,这样我才能在Windows上进行开发。但是当我执行mvn jetty:run时,我看到

代码语言:javascript
复制
[INFO] --- jetty-maven-plugin:9.1.3.v20140225:run (default-cli) @ web ---
[INFO] Configuring Jetty for project: web
[INFO] webAppSourceDirectory not set. Trying src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = E:\Ideas\xte\XTE\web\target\classes
[INFO] Context path = /
[INFO] Tmp directory = E:\Ideas\xte\XTE\web\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] web.xml file = file:/E:/Ideas/xte/XTE/web/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = E:\Ideas\xte\XTE\web\src\main\webapp

如您所见,webdefault.xml是从默认位置拉取的,而不是从指定位置拉取的。任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2014-07-04 20:40:06

问题是webAppConfigwebApp的别名,所以您应该删除它并将defaultsDescriptor添加到webApp中:

代码语言:javascript
复制
<webApp>
    <contextPath>/</contextPath>
    <defaultsDescriptor>src/main/resources/webdefault.xml</defaultsDescriptor> 
</webApp>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23394716

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档