在maven项目中,我在运行mvn包时收到以下错误:
[ERROR] Failed to execute goal org.codehaus.mojo:jspc-maven-plugin:1.4.6:compile (jspc) on project cto-reporting: Execution jspc of goal org.codehaus.mojo:jspc-maven-plugin:1.4.6:compile failed: A required class was missing while executing org.codehaus.mojo:jspc-maven-plugin:1.4.6:compile: org/apache/commons/logging/LogFactory
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:jspc-maven-plugin:1.4.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/c:/devapps/maven/repository/org/codehaus/mojo/jspc-maven-plugin/1.4.6/jspc-maven-plugin-1.4.6.jar
[ERROR] urls[1] = file:/c:/devapps/maven/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
[ERROR] urls[2] = file:/c:/devapps/maven/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[3] = file:/c:/devapps/maven/repository/log4j/log4j/1.2.13/log4j-1.2.13.jar
[ERROR] urls[4] = file:/c:/devapps/maven/repository/tomcat/jasper-compiler/5.5.15/jasper-compiler-5.5.15.jar
[ERROR] urls[5] = file:/c:/devapps/maven/repository/javax/servlet/jsp-api/2.0/jsp-api-2.0.jar
[ERROR] urls[6] = file:/c:/devapps/maven/repository/ant/ant/1.6.5/ant-1.6.5.jar
[ERROR] urls[7] = file:/c:/devapps/maven/repository/tomcat/jasper-compiler-jdt/5.5.15/jasper-compiler-jdt-5.5.15.jar
[ERROR] urls[8] = file:/c:/devapps/maven/repository/org/eclipse/jdt/core/3.1.1/core-3.1.1.jar
[ERROR] urls[9] = file:/c:/devapps/maven/repository/tomcat/jasper-runtime/5.5.15/jasper-runtime-5.5.15.jar
[ERROR] urls[10] = file:/c:/devapps/maven/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar
[ERROR] urls[11] = file:/c:/devapps/maven/repository/commons-el/commons-el/1.0/commons-el-1.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.commons.logging.LogFactory
从父母pom我得到以下信息:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
<webFragmentFile>C:\temp\web-fragment.xml</webFragmentFile>
<outputWebXml>C:\temp\jspweb.xml</outputWebXml>
</configuration>
</execution>
</executions>
<configuration>
<source>1.5</source>
<target>1.5</target>
<webFragmentFile>C:\temp\web-fragment.xml</webFragmentFile>
<outputWebXml>C:\temp\jspweb.xml</outputWebXml>
</configuration>
</plugin>
我试图在我的pom中添加commons-logging,即使它已经在父pom中了,我仍然得到同样的错误。 有谁知道什么可能是错的?以前该项目运作良好。
答案 0 :(得分:1)
出错的原因是我改为Maven 3.0.5,项目是在maven 2.2.1中创建的。所以通过改回2.2.1,一切都解决了。