sebastiandaschner blog
Using Maven Efficiently
friday, june 30, 2023Apache Maven is the most-used build tool in the Java world and omnipresent in the ecosystem. But so are over-usages and not-ideal practices when using Maven. In this video, I want to share my experiences and tips on how to be more pragmatic and efficient when using Maven.
Takeaways
-
Keep your Maven
pom.xml
lean and simple -
Keep your dependencies lean
-
Use Maven to build your application artifacts, not the whole world (containers, deployment, etc.)
-
Consider using
mvn clean package
for your Java projects (triggered via shell alias) -
dependency:tree
,help:effective-pom
and IDE tools can support you in debugging dependency & plugin issues -
Convention over configuration: Project structure,
pom.xml
definitions, properties, Surefire vs. Failsafe tests -
Rather avoid Maven modules
Found the post useful? Subscribe to my newsletter for more free content, tips and tricks on IT & Java: