我如何为 ehcache 构建一个 jar?

How can I build a single jar for ehcache?

使用echache 2.7.5,我试过了

mvn -Dmaven.test.skip=true package

但它制作了很多罐子:

./terracotta/bootstrap/target/ehcache-terracotta-bootstrap-2.7.5.jar
./management-ehcache/target/management-ehcache-2.7.5.jar
./ehcache-core/target/ehcache-core-2.7.5.jar
./ehcache-core/target/classes/net/sf/ehcache/pool/sizeof/sizeof-agent.jar
./ehcache-scheduled-refresh/target/ehcache-scheduled-refresh-2.7.5.jar
./ehcache/target/ehcache-2.7.5.jar
./management-ehcache-impl/ehcache-rest-agent/target/ehcache-rest-agent-2.7.5.jar
./management-ehcache-impl/ehcache-rest-agent/target/original-ehcache-rest-agent-2.7.5.jar
./management-ehcache-impl/management-ehcache-impl/target/management-ehcache-impl-2.7.5.jar

./ehcache/target/ehcache-2.7.5.jar

不包含任何 class 个文件。

如何定位单个 jar?

Ehcache 构建使用一个配置文件来构建其阴影 jar。配置文件名为 fullmode,需要激活:-Pfullmode.

默认值为 devmode,它不进行着色,而是生成具有适当传递依赖性的 pom 文件。这背后的逻辑是,对于想要测试内部组件更改而不必每次都重建完整 jar 的开发人员来说,构建时间更快。