I. Analysis
Ant is a software build tool, and Maven is positioned as a software project management and understanding tool. In addition to ant functions, Maven also adds the following main functions:
1) use the project object model to manage software projects;
2) More built-in implicit rules make building files easier;
3) built-in dependency management and repository for dependency management and Unified Storage;
4) built-in software build lifecycle;
II. Apache ant
• Ant has no formal conventions, such as the directory structure of a general project. You must clearly tell ant where to find the source code and where to place the output.
• Ant is programmatic. You must clearly tell ant what to do and when to do it. You must tell it to compile, copy, and compress.
• Ant has no lifecycle. You must define dependencies between the target and the target. You must manually attach a task sequence for each target.
3. Apache Maven
• Maven has a convention, because you have followed the Convention and it already knows where your source code is. It places the byte code to the target/classes, and then generates a jar file in the target.
• Maven is declarative. All you need to do is create a pom. xml file and put the source code to the default directory. Maven will help you deal with other things.
• Maven has a lifecycle that is called when you run MVN install. This command tells Maven to execute a series of ordered steps until it reaches your specified lifecycle.