Maven Tips & Tricks

Introduction

There is plenty of documentation (free e-books, tutorials, references) about Maven, but I thought about capturing somewhere all little tips, workarounds and good practices which I have come across using the tool or digging into documentation, forums and blogs.

Few words about Maven

Apache Maven is a Java tool for automated building and project management. It is similar to Apache Ant (they can be used in combination) but, compare to the former, it facilitates some key aspects such as dependencies management and extendibility.

Among others Maven coolest features are the POM (Project Object Model), the dependency management mechanism, profiles, extendibility (with plugins) and archetype (templating).

Practices and Tips

  1. Using Ant Tasks
  2. Unit Testing: define System Properties
  3. Installing Sun Jar Files
  4. Naming the artifact
  5. Executing SQL: creating Unit Test data
  6. Pom.xml, settings.xml, profiles.xml
  7. Add resources to the artifact
  8. Write into MANIFEST
  9. Unit Testing with different JDK
  10. Define an Internal Repository
  11. Deploy artifacts via SSH
  12. Using the Emma plug-in
  13. POM inheritance
  14. Using the SNAPSHOT mechanism
  15. Basic Authentication with the Maven repository

Resources

See the Maven Resources page.

Leave a Reply