maven install项目没有配置overlay怎么也能讲war项目合并来?
<dependency> <groupId>joker.good.custom</groupId> <artifactId>ExceptionHandler-Model</artifactId> <version>0.0.1</version> <type>war</type> <!-- <scope>runtime</scope> --> </dependency>
我在项目配置了一个war但是没有配置overlay插件但是执行install命令的时候还是会打印下面的语句
[INFO] --- maven-war-plugin:2.2:war (default-war) @ Permission-Model ---
[INFO] Packaging webapp
[INFO] Assembling webapp [Permission-Model] in [/Users/zhoukai/Documents/myWorkspace/Permission-Model/target/Permission-Model]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/zhoukai/Documents/myWorkspace/Permission-Model/src/main/webapp]
[INFO] Processing overlay [ id joker.good.custom:ExceptionHandler-Model]
[INFO] Webapp assembled in [3267 msecs]
[INFO] Building war: /Users/zhoukai/Documents/myWorkspace/Permission-Model/target/Permission-Model.war
[INFO] WEB-INF/web.xml already added, skipping
我遇到的问题是这样..我在项目使用maven管理 然后使用了jrebel+jetty运行项目,项目依赖另一个war项目,这两个war项目之间lib饮用的差不多..所以运行的时候如果把模块war项目的lib引用到项目中就会报错:
[INFO] Adding overlay: jar:file:/Users/zhoukai/.m2/repository/joker/good/custom/ExceptionHandler-Model/0.0.1/ExceptionHandler-Model-0.0.1.war!/
[INFO] Copying WEB-INF/lib jar:file:/Users/zhoukai/.m2/repository/joker/good/custom/ExceptionHandler-Model/0.0.1/ExceptionHandler-Model-0.0.1.war!/WEB-INF/lib/ to /Users/zhoukai/Documents/myWorkspace/Permission-Model/target/tmp/webinf/WEB-INF/lib
[INFO] Copying WEB-INF/classes from [file:/Users/zhoukai/Documents/myWorkspace/Permission-Model/src/main/webapp/WEB-INF/classes/, jar:file:/Users/zhoukai/.m2/repository/joker/good/custom/ExceptionHandler-Model/0.0.1/ExceptionHandler-Model-0.0.1.war!/WEB-INF/classes/] to /Users/zhoukai/Documents/myWorkspace/Permission-Model/target/tmp/webinf/WEB-INF/classes
[WARNING] Failed startup of context o.m.j.p.JettyWebAppContext{/Permission-Model,[file:/Users/zhoukai/Documents/myWorkspace/Permission-Model/target/tmp/webinf/, file:/Users/zhoukai/Documents/myWorkspace/Permission-Model/src/main/webapp/, jar:file:/Users/zhoukai/.m2/repository/joker/good/custom/ExceptionHandler-Model/0.0.1/ExceptionHandler-Model-0.0.1.war!/]},file:/Users/zhoukai/Documents/myWorkspace/Permission-Model/src/main/webapp/
java.lang.IllegalStateException: Duplicate fragment name: spring_web for jar:file:/Users/zhoukai/.m2/repository/org/springframework/spring-web/3.2.2.RELEASE/spring-web-3.2.2.RELEASE.jar!/META-INF/web-fragment.xml and jar:file:/Users/zhoukai/Documents/myWorkspace/Permission-Model/target/tmp/webinf/WEB-INF/lib/spring-web-3.2.2.RELEASE.jar!/META-INF/web-fragment.xml
at org.eclipse.jetty.webapp.MetaData.addFragment(MetaData.java:244)
at org.eclipse.jetty.webapp.FragmentConfiguration.findWebFragments(FragmentConfiguration.java:72)
at org.eclipse.jetty.webapp.FragmentConfiguration.preConfigure(FragmentConfiguration.java:39)
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:465)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:495)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppC......
我在插件配置了
<plugin> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <overlays> <overlay> <groupId>joker.good.custom</groupId> <artifactId>ExceptionHandler-Model</artifactId> <excludes> <exclude>WEB-INF/lib/*</exclude> <exclude>WEB-INF/web.xml</exclude> </excludes> </overlay> </overlays> </configuration> </plugin>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您好,我也遇到了相同的问题,没有配置overlays却生成了overlay,请问您最后是如何解决的?