Adding this dependency fixed it :-
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
<version>6.0.0</version>
</dependency>
java.lang.ClassNotFoundException: org.apache.jasper.runtime.JspApplicationContextImpl
解决方案:
Adding this dependency fixed it :-
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
<version>6.0.0</version>
</dependency>
2、在war中添加对jar包的依赖,报错:
Invalid classpath publish/export dependency /xxx. Project entries not supported
解决方案:在war包的pom.xml中添加:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
</additionalBuildcommands>
</configuration>
</plugin>
然后再
mvn eclipse:clean
mvn eclipse:eclipse
解释:
一般的eclipse的项目空间有.project和.classpath两个文件.执行eclipse:eclipse就是让maven的eclipse插件把.classpath内的jar引用地址重新更新一遍.
eclipse:clean就是删除所有eclipse项目文件在用eclipse:eclipse重建
3、在多模块项目运行时,执行 mvn jetty:run告警:
Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
在pom.xml中增加:
<properties>
<project.build.sourceEncoding>GBK</project.build.sourceEncoding>
</properties>
GBK是文件在系统中的编码来设置的。
4、将log4j.propertites文件放在src目录下,用Test类测试时正常使用,但发布后报错:
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.R
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
解决方案:
将log4j.propertites文件放在resources目录下。