依赖的jar包在maven仓库中下载不到的解决办法

ゝ一纸荒年。 2021-07-25 20:40 460阅读 0赞

建立一个单独的工程,来专门的管理外部手动下载的jar包,使其安装到我们自己的本地仓库中

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>com.funtl</groupId>
  7. <artifactId>my-shop-dependencies</artifactId>
  8. <version>1.0.0-SNAPSHOT</version>
  9. <relativePath>../my-shop-dependencies/pom.xml</relativePath>
  10. </parent>
  11. <artifactId>my-shop-external</artifactId>
  12. <packaging>jar</packaging>
  13. <name>my-shop-external</name>
  14. <description></description>
  15. <build>
  16. <plugins>
  17. <plugin>
  18. <groupId>org.apache.maven.plugins</groupId>
  19. <artifactId>maven-install-plugin</artifactId>
  20. <executions>
  21. <execution>
  22. <id>install-external-kaptcha</id>
  23. <!-- 触发时机:执行 mvn clean 命令时自动触发插件 -->
  24. <phase>clean</phase>
  25. <configuration>
  26. <!-- 存放依赖文件的位置 -->
  27. <file>${project.basedir}/libs/kaptcha-2.3.jar</file>
  28. <repositoryLayout>default</repositoryLayout>
  29. <!-- 自定义 groupId -->
  30. <groupId>com.google.code.kaptcha</groupId>
  31. <!-- 自定义 artifactId -->
  32. <artifactId>kaptcha</artifactId>
  33. <!-- 自定义版本号 -->
  34. <version>2.3</version>
  35. <!-- 打包方式 -->
  36. <packaging>jar</packaging>
  37. <!-- 是否自动生成 POM -->
  38. <generatePom>true</generatePom>
  39. </configuration>
  40. <goals>
  41. <goal>install-file</goal>
  42. </goals>
  43. </execution>
  44. </executions>
  45. </plugin>
  46. </plugins>
  47. </build>
  48. </project>

发表评论

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

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

相关阅读

    相关 Maven Jar依赖

    一、Jar 包的依赖范围 Maven 的 pom.xml 配置文件中 Jar 包的依赖范围: 依赖的范围有几个可选值, compile、test、provided、 r