2013-10-01 36 views
0

在Maven项目我正在MVN包时收到以下错误:JSPC - Maven的插件无法编译由于缺少类

[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中,并且我仍然得到相同的错误。 有没有人有一个想法可能是错误的?此前该项目运行良好。

回答

1

错误的原因是我已经更改为Maven 3.0.5,并且该项目是在maven 2.2.1中创建的。所以通过回到2.2.1,一切都解决了。

相关问题