Maven Animal Sniffer Plugin

微信扫一扫,分享到朋友圈

Maven Animal Sniffer Plugin

For the past few years, most of my personal and professional projects are built using Maven
. The dependency management and corresponding build lifecycle enable me to do some complex builds (for instance HBase 1.2.5 Client Jars).

Command

mvn dependency:tree -f demo-app/pom.xml

Result

[INFO] demo.app:demo-app:jar:1.0-SNAPSHOT
[INFO] +- junit:junit:jar:4.12:test
[INFO] |  - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] - org.apache.hbase:hbase:pom:1.2.5:compile
[INFO]    +- com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1:compile
[INFO]    - log4j:log4j:jar:1.2.17:compile

When these dependencies change underlying the build change, the build and debugging is a pain. I ran into this plugin Maven Animal Sniffer Plugin
. I did have to enable a specific configuration false

Command

mvn animal-sniffer:build -f demo-app/pom.xml

Result

[INFO] --- animal-sniffer-maven-plugin:1.16:build (default-cli) @ demo-app ---
[INFO] Parsing signatures from com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1
[INFO] Parsing signatures from log4j:log4j:jar:1.2.17
[INFO] Parsing signatures from /Users/paulbastide/Downloads/animal/demo-app/target/classes
[INFO] Wrote signatures for 337 classes.

I can now store this along with my build. The generated file demo-app/target/demo-app-1.0-SNAPSHOT.signature can then be used to check plugin

微信扫一扫,分享到朋友圈

Maven Animal Sniffer Plugin

你真的了解回调?

上一篇

okhttp 源码学习(一)基本用法

下一篇

你也可能喜欢

Maven Animal Sniffer Plugin

长按储存图像,分享给朋友