About Java build: Ant & Maven

Ant

Ant's hierarchical build script structure is like the following picture.

Ant has a lot of predefined tasks for file system and archiving operations. You can also write your own tasks in java.


About Java build: Ant & Maven_第1张图片
Document 1.png




 






  




  


......

About Java build: Ant & Maven_第2张图片
structures of the above script

some shortcomings

  • XML definition is very limited
  • need Ivy for dependency management
    ...

Maven

Based on the standard project layout and unified build lifecycle.

Standard Layout

eg. all source code sits in the directory src/main/java


About Java build: Ant & Maven_第3张图片
maven default layout

Lifecycle

  • compile
  • unit test and integration test
  • assemble (eg. JAR file)
  • deploy to the local repository
  • release to remote

Dependency Management

No need to explain.

Shortcoming

  • too restrictive
  • not stable

你可能感兴趣的:(About Java build: Ant & Maven)