maven 导出Jar包插件

柔光的暖阳◎ 2022-07-16 11:21 275阅读 0赞

红色部分为拷贝jar包插件配置

  1. <?xml version="1.0"?>
  2. <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>default-jar</groupId>
  7. <artifactId>test</artifactId>
  8. <version>0.0.1-SNAPSHOT</version>
  9. </parent>
  10. <groupId>default-jar</groupId>
  11. <artifactId>testjar</artifactId>
  12. <version>0.0.1-SNAPSHOT</version>
  13. <name>testjar</name>
  14. <url>http://maven.apache.org</url>
  15. <properties>
  16. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  17. </properties>
  18. <dependencies>
  19. <dependency>
  20. <groupId>junit</groupId>
  21. <artifactId>junit</artifactId>
  22. <version>3.8.1</version>
  23. <scope>test</scope>
  24. </dependency>
  25. </dependencies>
  26. <build>
  27. <plugins>
  28. <plugin>
  29. <groupId>org.apache.maven.plugins</groupId>
  30. <artifactId>maven-dependency-plugin</artifactId>
  31. <executions>
  32. <execution>
  33. <id>copy-dependencies</id>
  34. <phase>test</phase>
  35. <goals>
  36. <goal>copy-dependencies</goal>
  37. </goals>
  38. <configuration>
  39. <outputDirectory>
  40. target/classes/lib
  41. </outputDirectory>
  42. </configuration>
  43. </execution>
  44. </executions>
  45. </plugin>
  46. </plugins>
  47. </build>
  48. </project>
  49. <span style="color:#ff6666;"><build>
  50. <plugins>
  51. <plugin>
  52. <groupId>org.apache.maven.plugins</groupId>
  53. <artifactId>maven-dependency-plugin</artifactId>
  54. <executions>
  55. <execution>
  56. <id>copy-dependencies</id>
  57. <phase>test</phase>
  58. <goals>
  59. <goal>copy-dependencies</goal>
  60. </goals>
  61. <configuration>
  62. <outputDirectory>
  63. target/classes/lib
  64. </outputDirectory>
  65. </configuration>
  66. </execution>
  67. </executions>
  68. </plugin>
  69. </plugins>
  70. </build></span>

发表评论

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

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

相关阅读

    相关 maven导出项目依赖的jar

      现在java开发使用maven管理依赖非常方便,但是有一次,需要导出已经用maven配好的依赖包,结果发现maven的包存放,都是在本地仓库中一层一层文件夹存放的,并不会