Ihaveamavenprojectwiththefollowingpackages(forillustrationonly):我有一个包含以下包的maven项目(仅供参考): I have a maven project with the following packages (for illustration only): 我有一个包含以下包的maven项目(仅供
I have a maven project with the following packages (for illustration only):
我有一个包含以下包的maven项目(仅供参考):
Root: src/main/java
- /com/foo
- /com/foo/api
- /com/foo/impl
Now I want to create a jar which includes only code in /com/foo/api and /com/foo/impl.
现在我想创建一个jar,其中只包含/ com / foo / api和/ com / foo / impl中的代码。
How does one hack pom.xml to do this ? Thanks all.
如何破解pom.xml来做到这一点?谢谢大家。
1 个解决方案
#1
1
Easy, use the tag on the jar plugin:
很简单,使用jar插件上的 标签:
org.apache.maven.plugins maven-jar-plugin /com/foo/api/* /com/foo/impl/*There's a section on including/excluding in the usage section of the plugin doc.
在插件文档的使用部分中有一个关于包含/排除的部分。