Use maven in_right_way

917 views

Published on

Use Maven in Right Way, JEEconf 05/19/2012

Published in: Technology, Art & Photos
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
917
On SlideShare
0
From Embeds
0
Number of Embeds
326
Actions
Shares
0
Downloads
7
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Use maven in_right_way

  1. 1. Use Maven in Right Way Make build configurations effective with dependencyManagement, pluginManagement and profilesMonday, May 21, 12
  2. 2. Typical Dependency <dependency> <groupId>my-group1</groupId> <artifactId>artifact</artifactId> <version>1.0</version> </dependency>Monday, May 21, 12
  3. 3. Typical Dependency <dependency> <groupId>my-group1</groupId> <artifactId>artifact</artifactId> <version>1.0</version> </dependency>Monday, May 21, 12
  4. 4. Problem Set 20 dependencies chaotically distributed per 5 modules Review all modules to make change in dependency The worst case it takes 6 reviews The worst case it takes 120 changesMonday, May 21, 12
  5. 5. Version in property <artifact.version>1.0</artifact.version> <dependency> <groupId>my-group1</groupId> <artifactId>artifact</artifactId> <version>${artifact.version}</version> </dependency>Monday, May 21, 12
  6. 6. Extended Dependency <dependency> <groupId>my-group1</groupId> <artifactId>artifact</artifactId> <version>${artifact.version}</version> <scope>provided</scope> <classifier>jdk15</classifier> <optional>true</optional> <packaging>zip</packaging> </dependency>Monday, May 21, 12
  7. 7. Exclusions <dependency> <groupId>my-group1</groupId> <artifactId>artifact</artifactId> ... <exclusions> <exclusion> <groupId>exclude-group</groupId> <groupId>exclude</groupId> </exclusion> </exclusions> </dependency>Monday, May 21, 12
  8. 8. Inject ManagementMonday, May 21, 12
  9. 9. Solution 1 All dependency configuration in one place The worst case it takes 1 review to change ANY property of ANY dependency The worst case it takes 20 changesMonday, May 21, 12
  10. 10. Typical Plugin <build> <plugins> <plugin> <groupId>plugin-group</groupId> <artifactId>plugin</artifactId> <version>1.0</version> <configuration>...</configuration> <executions>...</executions> </plugin> </plugins> </build>Monday, May 21, 12
  11. 11. Problem Set 2 10 plugins chaotically distributed per 5 modules Duplicates The worst case it takes 6 reviews to update plugins The worst case it takes 240 changesMonday, May 21, 12
  12. 12. Inject ManagementMonday, May 21, 12
  13. 13. Solution 2 All plugins defines in one place NO DUPLICATES In the worst case it takes 1 review to update plugins In the worst case it takes 40 changesMonday, May 21, 12
  14. 14. Monday, May 21, 12
  15. 15. One more thing...Monday, May 21, 12
  16. 16. Problem Set 3 Separate unit tests and integration tests Integration environment to run integration tests ONLYMonday, May 21, 12
  17. 17. Solution 3 Integration profile Common configuration in default pluginManagement Executions & configuration customization in profileMonday, May 21, 12
  18. 18. Thank you! Anton Naumov email: anton.naumow@gmail.com twitter: antonnaumov blog: http://antonnaumov.posterous.comMonday, May 21, 12

×