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

推荐订阅源

J
Java Code Geeks
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
Recent Announcements
Recent Announcements
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 张皓

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>