mvn clean package 程序包com.google.gson不存在


錯誤

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project renren-fast: Compilation failure: Compilation failure:
[ERROR] /C:/work/code/mucp_front/mucp-back/src/main/java/io/renren/common/utils/RedisUtils.java:[11,23] 程序包com.google.gson不存在
[ERROR] /C:/work/code/mucp_front/mucp-back/src/main/java/io/renren/common/utils/RedisUtils.java:[41,26] 找不到符號
[ERROR]   符號:   類 Gson
[ERROR]   位置: 類 io.renren.common.utils.RedisUtils
[ERROR] /C:/work/code/mucp_front/mucp-back/src/main/java/io/renren/modules/oss/controller/SysOssController.java:[11,23] 程序包com.google.gson不存在
[ERROR] /C:/work/code/mucp_front/mucp-back/src/main/java/io/renren/modules/sys/oauth2/OAuth2Filter.java:[11,23] 程序包com.google.gson不存在
[ERROR] /C:/work/code/mucp_front/mucp-back/src/main/java/io/renren/modules/sys/service/impl/SysConfigServiceImpl.java:[14,23] 程序包com.google.gson不存在
[ERROR] /C:/work/code/mucp_front/mucp-back/src/main/java/io/renren/modules/sys/oauth2/NoneFilter.java:[11,23] 程序包com.google.gson不存在
[ERROR] /C:/work/code/mucp_front/mucp-back/src/main/java/io/renren/common/aspect/SysLogAspect.java:[11,23] 程序包com.google.gson不存在
[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

 解決方法

 

在pom.xml添加一下內容

<dependency>
          <groupId>com.google.code.gson</groupId>
          <artifactId>gson</artifactId>
          <version>1.7.2</version>
  </dependency>

保存------執行maven-update project


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM