Maven Tips & Tricks


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
  16. Improve Unit Testing performance: JVM memory settings
  17. Run SQLPLUS with the exec-maven-plugin
  18. Include jar files during packaging


See the Maven Resources page.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: