Releasing Projects Using Maven

3,732 views

Published on

Slides used for "Releasing Projects Using Maven" session at the PinoyJUG meetup on Oct. 27, 2009 (G2iX Tech Bar).

Published in: Technology, Business
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,732
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
88
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

Releasing Projects Using Maven

  1. 1. Releasing Projects  Using Maven Deng Ching Senior Software Engineer – G2iX    
  2. 2. Maven is a software project  management and build comprehension  tool. Based on the concept of a  project object model (POM), Maven  can manage a project's build,  reporting and documentation from a  central piece of information.    
  3. 3. Maven Concepts  POM – Project Object Model  Artifact  Dependency  Build lifecycle  Maven plugins  Multi­module projects  $USER_HOME/.m2/    
  4. 4. How Maven Works...    
  5. 5. The Maven POM  Artifact coordinates:  groupId  artifactId  version (SNAPSHOTs vs. releases)  Modules  Build management  Reporting  Profiles    
  6. 6. Releasing Projects Using  Maven  Release early, release often  Maven Release plugin    
  7. 7. Configuration and Pre­ requisites  Project version (must be a SNAPSHOT  version)  Dependency and plugin versions  SCM configuration <scm>   <connection>scm:svn:http://svn.pinoyjug.org/sample/trunk</connection>   <developerConnection>scm:svn:http://svn.pinoyjug.org/sample/trunk</developerConnection>   <url>http://svn.pinoyjug.org/sample/trunk</url> </scm>    
  8. 8. Configuration and Pre­ requisites  Distribution Management config <distributionManagement>   <repository>     <id>releases</id>     <name>Internal Releases Repository</name>     <url>http://localhost:8081/archiva/repository/releases</url>   </repository>   <snapshotsRepository>     <id>releases</id>     <name>Internal Snapshots Repository</name>     <url>http://localhost:8081/archiva/repository/snapshots</url>   </snapshotsRepository> </distributionManagement>    
  9. 9. Configuration and Pre­ requisites  settings.xml configuration <settings>   <servers>     <server>       <id>releases</id>       <name>Internal Releases Repository</name>       <username>deng</username>       <password>pass1<password>     </server>     <server>       <id>snapshots</id>       <name>Internal Snapshots Repository</name>       <username>deng</username>       <password>pass1<password>     </server>   </servers> </settings>    
  10. 10. Maven Release Plugin  release goals:  prepare  perform  clean  rollback  stage  branch    
  11. 11. Maven Release Profile  Super POM <profile>   <id>release­profile</id>   <activation>     <property>       <name>performRelease</name>       <value>true</value>     </property>   </activation>   <build>     <plugins>       ...     </plugins>   </build> </profile>    
  12. 12. Maven Release Profile  Custom release profile <plugin>   <groupId>org.apache.maven.plugins</groupId>   <artifactId>maven­release­plugin</artifactId>   <version>2.0­beta­9</version>   <configuration>     <useReleaseProfile>false</useReleaseProfile>     <arguments>­Pcustom­release­profile</arguments>   </configuration> </plugin>    
  13. 13. Maven Release Process  release:prepare  check for SNAPSHOTs  versioning   check for build errors  create tag  release:perform  deploy project  release cleanup    
  14. 14. Troubleshooting Releases  Common errors during release:  local modifications   current version is not a SNAPSHOT  SNAPSHOT dependencies and plugins  missing <scm> configuration  tag already exists    
  15. 15. Troubleshooting Releases  Common errors during release:  unable to deploy project to the  repository  connection problems    
  16. 16. Resources  http://maven.apache.org  Apache Maven 2 Effective  Implementations book    
  17. 17. Questions?    
  18. 18. Thank You...    

×