Last active
February 20, 2023 06:16
-
-
Save programsimon/744f1767371d8cdd61b0b76a5ac9d018 to your computer and use it in GitHub Desktop.
[Maven打包插件不打包依赖] 在不需要将所有依赖打在包中时使用,jar包中仅保存开发代码部分。#java #maven #jar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- 打包时排除yml文件 --> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-jar-plugin</artifactId> | |
| <configuration> | |
| <excludes> | |
| <exclude>**/*.yml</exclude> | |
| </excludes> | |
| </configuration> | |
| </plugin> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-dependency-plugin</artifactId> | |
| <version>2.10</version> | |
| <executions> | |
| <execution> | |
| <id>copy</id> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>copy-dependencies</goal> | |
| </goals> | |
| <configuration> | |
| <outputDirectory> | |
| ${project.build.directory}/lib | |
| </outputDirectory> | |
| </configuration> | |
| </execution> | |
| </executions> | |
| </plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment