惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google DeepMind News
Google DeepMind News
博客园_首页
云风的 BLOG
云风的 BLOG
月光博客
月光博客
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
D
Docker
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
博客园 - 叶小钗
Martin Fowler
Martin Fowler
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - 张皓

Stereoscopic Player 1.7.4 (SSP) 加载字幕 layout_weight体验(实现按比例显示) Linux5配置jboss环境 pager-taglib 分页扩展实例 DisplayTag1.2 扩展(自定义分页、排序、导出、页面导航) EJB3在JBoss5内集群探究 JBoss5开发web service常见问题 jboss启动常见的错误 ADO连接池 IDUdpServer研究心得 DLL内线程同步主线程研究(子线程代码放到主线程执行) DBGrid内使用CheckBox功能 子绑定控件获取父绑定项的值 - 张皓 - 博客园 IdTcpServer 用户掉线检测方法 . Net环境下消息队列(MSMQ)对象的应用[转] 消息队列(Message Queue)简介及其使用[转] 分布式事务TransactionScope小结[转] 分布式事务的点滴 调试SQL Server存储过程方法
maven2 Jetty运行多模块的web application
张皓 · 2010-10-25 · via 博客园 - 张皓

maven2 Jetty运行多模块的web application

方法一:

设置extraClasspath,见一下程序结构

  • pom.xml (packaging pom, has two modules)
  • m2_common01/
    • pom.xml (packaging jar<
  • m2_webapp01/
    • pom.xml(packaging war, depends on m2_common01)

曾尝试着在m2_webapp01/pom.xml内配置但是没有成功,后在主项目内pom.xml内配置运行正常,具体配置如下:

     <plugins>

        ......

        <plugin>

          <groupId>org.mortbay.jetty</groupId>

          <artifactId>jetty-maven-plugin</artifactId>

          <!-- 此版7.2.0.v20101020本可用,8.0.0.M1不可用 -->

            <version>7.2.0.v20101020</version>

          <configuration>

             <webAppSourceDirectory>${basedir}/m2_webapp01/src/main/webapp</webAppSourceDirectory>

             <classesDirectory>${basedir}/m2_webapp01/target/classes</classesDirectory>

            <scanIntervalSeconds>2</scanIntervalSeconds>

            <stopKey>foo</stopKey>

          <stopPort>9999</stopPort>

            <webAppConfig>

              <contextPath>/m2_webapp01</contextPath>

<!-- 设置extraClasspath,多个用";"隔开 -->

              <extraClasspath>${basedir}/m2_common01/target/classes</extraClasspath>

            </webAppConfig>

<!-- 设置监听目录 -->

            <scanTargets>

              <scanTarget>${basedir}/m2_common01/target/classes</scanTarget>

            </scanTargets>

          </configuration>

        </plugin>

        ......

     </plugins>