maven copy jar 插件


 插件比较特殊 eclipse下的 首先声明插件
 
   
  1. <pluginManagement>
  2. <plugin>
  3. <groupId>org.apache.maven.plugins</groupId>
  4. <artifactId>maven-compiler-plugin</artifactId>
  5. <configuration>
  6. <source>1.6</source>
  7. <target>1.6</target>
  8. </configuration>
  9. </plugin>
  10. <plugin>
  11. <groupId>org.eclipse.m2e</groupId>
  12. <artifactId>lifecycle-mapping</artifactId>
  13. <version>1.0.0</version>
  14. <configuration>
  15. <lifecycleMappingMetadata>
  16. <pluginExecutions>
  17. <pluginExecution>
  18. <pluginExecutionFilter>
  19. <groupId>org.apache.maven.plugins</groupId>
  20. <artifactId>maven-dependency-plugin</artifactId>
  21. <versionRange>[2.0,)</versionRange>
  22. <goals>
  23. <goal>copy-dependencies</goal>
  24. </goals>
  25. </pluginExecutionFilter>
  26. <action>
  27. <ignore />
  28. </action>
  29. </pluginExecution>
  30. </pluginExecutions>
  31. </lifecycleMappingMetadata>
  32. </configuration>
  33. </plugin>
  34. </plugins>
  35. </pluginManagement>

引入自定义插件

 
   
  1. <plugins>
  2. <!-- remove jar plugins -->
  3. <plugin>
  4. <groupId>org.apache.maven.plugins</groupId>
  5. <artifactId>maven-clean-plugin</artifactId>
  6. <executions>
  7. <execution>
  8. <id>clean</id>
  9. <phase>install</phase>
  10. <goals>
  11. <goal>clean</goal>
  12. </goals>
  13. <configuration>
  14. <directory>/src/main/webapp/WEB-INF/lib</directory>
  15. </configuration>
  16. </execution>
  17. </executions>
  18. </plugin>
  19. <!-- copy jar plugins -->
  20. <plugin>
  21. <groupId>org.apache.maven.plugins</groupId>
  22. <artifactId>maven-dependency-plugin</artifactId>
  23. <executions>
  24. <execution>
  25. <id>copy-dependencies</id>
  26. <phase>package</phase>
  27. <goals>
  28. <goal>copy-dependencies</goal>
  29. </goals>
  30. <configuration>
  31. <outputDirectory>src/main/webapp/WEB-INF/lib</outputDirectory>
  32. <excludeTransitive>false</excludeTransitive>
  33. <stripVersion>false</stripVersion> <!-- 复制jar 的时候去掉版本信息 true : 去掉 false: 不去掉 -->
  34. <includeScope>runtime</includeScope>
  35. </configuration>
  36. </execution>
  37. </executions>
  38. </plugin>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值