Java Build Tools

1,007 views

Published on

comparison of java build tools

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,007
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Java Build Tools

  1. 1. Java Build Tools
  2. 2.  Desired Features  Ant  Maven  Ant vs MavenCONTENTS
  3. 3. Whats expected of build • Versioning • Compile Java code, build jars • Execute tests and report results • Run quality-check tools (PMD, Findbugs..) • Build vs. deploy vs. release • Cross-platform • IDE Support • Documentation / Supporttools
  4. 4.  Java-based build tool  Mature  Stable  Rich library of tasksWHY ANT!
  5. 5.  Ant With Convention Over Configuration  Dependency Management  Uniform Build System.  Project Structure.  Coherent site of project information along-with Internationalization.  Release management and distribution publication.WHY MAVEN!
  6. 6. Concerns to build a project  Project directory structure  Directory naming conventions  The build output
  7. 7.  Contains project information and configuration details used to build the project ◦ – Project dependencies ◦ – Commands (goals) that can be executedProject Object Model ◦ – Plugins ◦ – Metadata  The minimum requirement for a POM are the following: ◦ project root ◦ modelVersion - should be set to 4.0.0 ◦ groupId - the id of the projects group. ◦ artifactId - the id of the artifact (project) ◦ version - the version of the artifact under the specified group e.g.: ◦ <modelVersion>4.0.0</modelVersion> ◦ <groupId>com.cisco.ccw.config</groupId> ◦ <artifactId>ConfigService</artifactId> ◦ <packaging>jar</packaging> ◦ <version>7.0</version> ◦ <name>CCW Config Services</name> ◦ <url>http://www.cisco.com</url>
  8. 8. Project inheritance
  9. 9. Project aggregation
  10. 10. Build Lifecycle and Phases Most important default phases: ◦ Validate ◦ Compile ◦ Test ◦ Package ◦ Install ◦ Deploy Some common phases not default: ◦ Clean ◦ Site
  11. 11. Dependency scope Compile: Available in all classpaths (default) Provided: The JDK or the container provides it Runtime: Only required for execution, not for compilation Test: Only required for testing, not for normal use (not deployed) System: You provide it locally, not looked up in a repo  <dependency>  <groupId>commons-logging</groupId>  <artifactId>commons-logging</artifactId>  <version>1.4</version>  <scope>compile</scope>  </dependency>
  12. 12. FEATURES ANT MAVEN Dependency Management Versioning Manually defined Compile Java code, build jars Execute tests, report results, fail build on failed tests Build vs. deploy vs. release Manually defined Full control when needed Custom XML Write custom “scripts” plugin or embedded Ant script Documentation / Support Excellent Growing but stillAnt vs Maven inconsistent Run quality check tools (PMD, FindBugs, JavaDoc) 3rd party task 3rd party plugins libraries File generation (XmlBeans, XSL, Velocity, AspectJ) 3rd party task 3rd party plugins libraries Generating the Site
  13. 13. Reference http://en.wikipedia.org/wiki/List_of_build_automation_softwar e http://maven.apache.org/maven-features.html

×