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

推荐订阅源

T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
V
V2EX
GbyAI
GbyAI
量子位
Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
S
SegmentFault 最新的问题
O
OpenAI News
N
News and Events Feed by Topic
博客园 - Franky
爱范儿
爱范儿
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
Last Week in AI
Last Week in AI
罗磊的独立博客
Spread Privacy
Spread Privacy
Recent Announcements
Recent Announcements
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
Y
Y Combinator Blog
J
Java Code Geeks
I
Intezer

博客园 - 张皓

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>