Maven配置 - settings.xml

深碍√TFBOYSˉ_ 2023-06-25 04:53 59阅读 0赞

Maven配置 - settings.xml

  • settings.xml
  • 缺少jar文件
    • 方法一: maven update
    • 方法二: 使用中央仓库
    • 方法三: 复制jar文件

settings.xml

  1. <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  2. <!-- <localRepository>D:\home\java\maven_repository</localRepository> -->
  3. <interactiveMode />
  4. <usePluginRegistry />
  5. <offline />
  6. <pluginGroups />
  7. <servers />
  8. <mirrors>
  9. <mirror>
  10. <id>nexus</id>
  11. <name>Tedu Maven</name>
  12. <mirrorOf>*</mirrorOf>
  13. <url>http://maven.tedu.cn/nexus/content/groups/public/</url>
  14. </mirror>
  15. <!-- <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> -->
  16. </mirrors>
  17. <proxies />
  18. <profile>
  19. <id>jdk18</id>
  20. <activation>
  21. <activeByDefault>true</activeByDefault>
  22. <jdk>1.8</jdk>
  23. </activation>
  24. <properties>
  25. <maven.compiler.source>1.8</maven.compiler.source>
  26. <maven.compiler.target>1.8</maven.compiler.target>
  27. <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
  28. </properties>
  29. </profile>
  30. <activeProfiles />
  31. </settings>

缺少jar文件

方法一: maven update

  • 在本地仓库目录搜索 “*.lastupdate”
  • 删除所有找到的文件
  • 在eclipse中,右键点击项目–maven–Update Project

方法二: 使用中央仓库

使用的国内镜像仓库可能缺少最新的jar文件

可以把所有镜像仓库注释掉,使用maven的中央仓库

方法三: 复制jar文件

以上方法都没用,那么可以复制别人可用的仓库,复制缺少的jar文件

发表评论

表情:
评论列表 (有 0 条评论,59人围观)

还没有评论,来说两句吧...

相关阅读