使用IDEA开发maven项目jetty:run不成功

Lucare 2016-01-26 06:09:12
在IDEA下搭建了一个springmvc+mybatis的maven项目,使用maven据说还是jetty做容器好,于是我在pom.xml中加上jetty的插件:

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.9.v20130131</version>
<configuration>
<webApp>
<contextPath>/${project.artifactId}</contextPath>
</webApp>
<stopKey>STOP</stopKey>
<stopPort>9999</stopPort>
<scanIntervalSeconds>5</scanIntervalSeconds>
</configuration>
</plugin>


启动的时候,网上都是说只需要jetty:run就行了,我就照做了,结果老是编译不完全。还输出以下信息:

[INFO] --- jetty-maven-plugin:8.1.9.v20130131:run (default-cli) @ wechatplat ---
[INFO] Configuring Jetty for project: wechatplat Maven Webapp
[INFO] webAppSourceDirectory not set. Defaulting to D:\devTools\IdeaProjects\wechatplat\src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = D:\devTools\IdeaProjects\wechatplat\target\classes
[INFO] Context path = /wechatplat
[INFO] Tmp directory = D:\devTools\IdeaProjects\wechatplat\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = file:/D:/devTools/IdeaProjects/wechatplat/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = D:\devTools\IdeaProjects\wechatplat\src\main\webapp
[INFO] jetty-8.1.9.v20130131
[INFO] No Transaction manager found - if your webapp requires one, please configure one.
[INFO] No Spring WebApplicationInitializer types detected on classpath
[INFO] Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[INFO] Initializing Spring FrameworkServlet 'rest'
[INFO] Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.



后来我用IDEA自己的build中的make project,然后在jetty:run,结果就好了。

我想问问直接使用jetty:run为什么不行,是不是我哪里没有配好。

怎么才能做到热部署?
...全文
510 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Lucare 2016-01-27
  • 打赏
  • 举报
回复
从此以后,不在csdn论坛发帖求助。
特里12 2016-01-26
  • 打赏
  • 举报
回复
mark 不用maven好多年了

10,606

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧