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
- Using Ant Tasks
- Unit Testing: define System Properties
- Installing Sun Jar Files
- Naming the artifact
- Executing SQL: creating Unit Test data
- Pom.xml, settings.xml, profiles.xml
- Add resources to the artifact
- Write into MANIFEST
- Unit Testing with different JDK
- Define an Internal Repository
- Deploy artifacts via SSH
- Using the Emma plug-in
- POM inheritance
- Using the SNAPSHOT mechanism
- Basic Authentication with the Maven repository
- Improve Unit Testing performance: JVM memory settings
- Run SQLPLUS with the exec-maven-plugin
- Include jar files during packaging
See the Maven Resources page.