maven工程坑爹

运行基于maven的工程打包一直报错,收不了,只好跳过临时跳过测试打包。
使用命令:
mvn package -Dmaven.test.skip=true

打包成功了,放到tomcat下面有出现了异常。
报错一个jar包不可读,怀疑打包出来问题,故将maven引入的导出对比。
mavne导出包命令:
mvn dependency:copy-dependencies -DoutputDirectory=lib   -DincludeScope=compile

结果该有的包都有的。启动之后访问页面存在报错。
报错信息:
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /jsp/home.jsp(3,0) /jsp/common/taglib.jsp(2,62) Unable to read TLD "META-INF/c.tld" from JAR file "file:/G:/workspace/obd/obdweb/target/obdweb/WEB-INF/lib/jstl-1.2.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
	at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:300)
	at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:333)
	at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:442)
	at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1397)
	at org.apache.jasper.compiler.Parser.parse(Parser.java:130)
	at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
	at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:167)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:619)


上网看了看,大家都是在 server-api.jar 与 stand.jar 的问题。由于报错的为c.tld不可以读,这个文件出来在 jstl-1.2.jar中和stant.jar中,很可能是有由于两个包有冲突,我讲jstl换成1.1.2版本,问题依然存在。悲剧...
后来才发现,mvn将jsp-api-2.1.jar包打包放入lib目录下与tomcat下面的jar冲突。删除jsp-api-2.1.jar包再重启问题不在有

你可能感兴趣的:(java,maven)