gpt4 book ai didi

java - jspc-maven-plugin 由于缺少类而无法编译

转载 作者:行者123 更新时间:2023-12-01 14:03:38 25 4
gpt4 key购买 nike

在 Maven 项目中,运行 mvn package 时收到以下错误:

[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 中添加公共(public)日志记录,即使它已经在父 pom 中,但我仍然遇到相同的错误。有谁知道可能出了什么问题吗?以前该项目运行良好。

最佳答案

报错的原因是我改成了Maven 3.0.5,项目是用maven 2.2.1创建的。于是改回2.2.1,一切都解决了。

关于java - jspc-maven-plugin 由于缺少类而无法编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19119280/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com