gpt4 book ai didi

java - maven编译错误

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

正在处理 Maven 项目。我正在尝试使用 Maven 进行构建,但出现以下错误!我正在使用 JDK 8 开发 Eclipse。

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)

我也尝试了上述解决方案,但仍然出现错误!

[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building RESTfulWebServiceExample 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ RESTfulWebServiceExample ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Tomcat 7.0\webapps\RESTfulWebServiceExample\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ RESTfulWebServiceExample ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to D:\Tomcat 7.0\webapps\RESTfulWebServiceExample\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[4,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[5,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[6,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[7,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[8,24] package javax.ws.rs.core does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[10,2] cannot find symbol
symbol: class Path
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[18,40] cannot find symbol
symbol: class PathParam
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[15,7] cannot find symbol
symbol: class GET
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[16,7] cannot find symbol
symbol: class Path
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[17,8] cannot find symbol
symbol: class Produces
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[33,40] cannot find symbol
symbol: class PathParam
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[30,8] cannot find symbol
symbol: class Path
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[31,8] cannot find symbol
symbol: class GET
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[32,8] cannot find symbol
symbol: class Produces
location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[INFO] 14 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.041 s
[INFO] Finished at: 2015-06-15T11:33:01+05:30
[INFO] Final Memory: 12M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project RESTfulWebServiceExample: Compilation failure: Compilation failure:
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[4,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[5,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[6,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[7,19] package javax.ws.rs does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[8,24] package javax.ws.rs.core does not exist
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[10,2] cannot find symbol
[ERROR] symbol: class Path
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[18,40] cannot find symbol
[ERROR] symbol: class PathParam
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[15,7] cannot find symbol
[ERROR] symbol: class GET
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[16,7] cannot find symbol
[ERROR] symbol: class Path
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[17,8] cannot find symbol
[ERROR] symbol: class Produces
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[33,40] cannot find symbol
[ERROR] symbol: class PathParam
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[30,8] cannot find symbol
[ERROR] symbol: class Path
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[31,8] cannot find symbol
[ERROR] symbol: class GET
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] /D:/Tomcat 7.0/webapps/RESTfulWebServiceExample/src/org/test/webservices/FeetToInchAndInchToFeetConversionService.java:[32,8] cannot find symbol
[ERROR] symbol: class Produces
[ERROR] location: class org.test.webservices.FeetToInchAndInchToFeetConversionService
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

最佳答案

检查以下依赖项是否存在?

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0-m01</version>
</dependency>

关于java - maven编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30838371/

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