Introduction of Build Tool / Maven, Gradle maven in the end is hell ~

What is a build tool?

  Build tool executable application are automatically created from the source code program (e.g. .apk for android app). Construction comprising code compilation, linking, and packaged into usable form or executable.

Basically, building automation is the behavior of various tasks or scripts automate the software development personnel in their daily activities, such as:

  1. Download dependencies.
  2. The source code is compiled into binary code.
  3. Packaged binary code.
  4. Run the test.
  5. Deployed to the production system.

 

Why do we use the build tool or build automation?

  In small projects, developers often build process manually invoked. This large project is not practical in these projects is difficult to track what needs to be built, the sequence of the process of building and dependencies. Automated tools can make the build process more consistent.

 

It offers a variety of build tools (name only a few):

  1. For java - Ant, Maven, Gradle.
  2. For the .NET Framework - NAnt
  3. c# - MsBuild。

 

maven in the end is hell -

 

      I remember watching the instructional video maven repeat several times before they get to know maven. I do not know myself how savvy or drops too low, it is not clear, now figure out, basically beginning. The Bowen wrote, it is to help those who, like me, who stumbled to maven. Blessed are basically reading you will find that so simple. 

      Reference Bowen: Popular understand maven

      The lengthy article, probably roadmap is as follows

          maven introduction, a preliminary understanding to acquire three key attributes jar package -> Introduction warehouses (acquired jar package comes from) -> command line management maven project (to create a maven project) -> Create a myeclipse maven project -> Details dependencies in pom.xml (coordinate acquisition, various attributes of the package to explain the positioning jar.

                              --WH

 

First, the simple little question?

    Before explaining, to mention a small problem.

      1.1, if you are under development two Eclipse Java project, let's call them A, B, where A project some features depend on some type B project, how to maintain this dependency it?

        Very simple, is not that just like when we write programs before you, what kind of projects which need, which is written by someone else's function code, you can import the jar package. So is also the case here, items B may be labeled jar package, and then import the jar at Library A B project, so, A program can call some of the Category B.

        Doing so several defects

          If the development process, found in the B bug, you must modify the B good project, and re-packaged and B A project recompilation operation

          A project after the completion of the development, in order to ensure the normal operation of A, you need to rely on B (as must rely upon the use of a jar package as another jar), two solutions, first select the package B the A, the second, B will also release out, such as when other people need to use A, told the developers, we want to use A must import Bjar package. Two very troublesome, the former may be a waste of resources (for example, a developer may be developing other projects depend on the B, B has been stored locally, and then there will be a jar in a jar import A two B's) which we often encounter, find a variety of jar package, very troublesome (With maven is not the same)

 

      1.2, we have developed a project, or do a little demo, such as using SSH framework, then we have to SSH framework used in dozens of dependent jar package in order to find out and manually import, super complicated. 

    

    Two issues described above, in fact, are all dependent on project to project problems [A project using all the jar SSH, and said A project dependencies SSH] , man-made to resolve them manually, it is cumbersome, is not easy, so use maven to help us manage

 

Two, maven in the end what is?

    Maven is based on a project object model (POM project object model), you can build information (configuration) to manage the project by a short description, software project management reports and documentation tools [Baidu Encyclopedia]

    This is a major vernacular, if you do not understand what is maven, then the above did not say these words, like, I feel, Maven's core function is a reasonable description of dependencies between projects, popular speak, it is by pom. xml configuration file acquisition jar package, without having to manually add the jar package, and here pom.xml file to learn a little maven people, a bit familiar, how by pom.xml configuration you can get to the jar package it? pom.xml configuration file come from? And so a similar problem we need to figure out, if you need to use to get the pom.xml jar package, then the project must first of all as a maven project, maven project so you can think about is that in the above project and java web project wrapped with a layer maven, in essence java java project or projects, web or web project, but then wrapped maven, you can use some of the features provided by the maven (jar package by adding pom.xml).

    Therefore, in accordance with the previous paragraph description, our ultimate goal is to learn how to configure what we want to get a jar in pom.xml, before we have to understand how to create a maven project, maven project structure is how, and ordinary java, where the difference in the web project, and how to configure pom.xml get to the corresponding jar package and so on, here in advance to find out how we want to get to the jar by pom.xml files, depending more about this later this configuration file.

    pom.xml obtain written jar package junit of.

          

    Why you can locate a jar package through groupId, artifactId, version three properties?

        Added to the upper part of pom.xml file A project, A project is definitely a maven project, by the above three properties can be found junit jar corresponding version of the package, then the project is certainly a junit maven project, the junit maven project pom.xml file will have three identifiers, like the figure below this, then the project will be able to find other maven jar package junit projects through these three attributes. Therefore, in each maven project created will be asked to write these three property values.

          

      I remember watching the instructional video maven repeat several times before they get to know maven. I do not know myself how savvy or drops too low, it is not clear, now figure out, basically beginning. The Bowen wrote, it is to help those who, like me, who stumbled to maven. Blessed are basically reading you will find that so simple. 

      Reference Bowen: Popular understand maven

      The lengthy article, probably roadmap is as follows

          maven introduction, a preliminary understanding to acquire three key attributes jar package -> Introduction warehouses (acquired jar package comes from) -> command line management maven project (to create a maven project) -> Create a myeclipse maven project -> Details dependencies in pom.xml (coordinate acquisition, various attributes of the package to explain the positioning jar.

                              --WH

 

First, the simple little question?

    Before explaining, to mention a small problem.

      1.1, if you are under development two Eclipse Java project, let's call them A, B, where A project some features depend on some type B project, how to maintain this dependency it?

        Very simple, is not that just like when we write programs before you, what kind of projects which need, which is written by someone else's function code, you can import the jar package. So is also the case here, items B may be labeled jar package, and then import the jar at Library A B project, so, A program can call some of the Category B.

        Doing so several defects

          If the development process, found in the B bug, you must modify the B good project, and re-packaged and B A project recompilation operation

          A project after the completion of the development, in order to ensure the normal operation of A, you need to rely on B (as must rely upon the use of a jar package as another jar), two solutions, first select the package B the A, the second, B will also release out, such as when other people need to use A, told the developers, we want to use A must import Bjar package. Two very troublesome, the former may be a waste of resources (for example, a developer may be developing other projects depend on the B, B has been stored locally, and then there will be a jar in a jar import A two B's) which we often encounter, find a variety of jar package, very troublesome (With maven is not the same)

 

      1.2, we have developed a project, or do a little demo, such as using SSH framework, then we have to SSH framework used in dozens of dependent jar package in order to find out and manually import, super complicated. 

    

    Two issues described above, in fact, are all dependent on project to project problems [A project using all the jar SSH, and said A project dependencies SSH] , man-made to resolve them manually, it is cumbersome, is not easy, so use maven to help us manage

 

Two, maven in the end what is?

    Maven is based on a project object model (POM project object model), you can build information (configuration) to manage the project by a short description, software project management reports and documentation tools [Baidu Encyclopedia]

    This is a major vernacular, if you do not understand what is maven, then the above did not say these words, like, I feel, Maven's core function is a reasonable description of dependencies between projects, popular speak, it is by pom. xml configuration file acquisition jar package, without having to manually add the jar package, and here pom.xml file to learn a little maven people, a bit familiar, how by pom.xml configuration you can get to the jar package it? pom.xml configuration file come from? And so a similar problem we need to figure out, if you need to use to get the pom.xml jar package, then the project must first of all as a maven project, maven project so you can think about is that in the above project and java web project wrapped with a layer maven, in essence java java project or projects, web or web project, but then wrapped maven, you can use some of the features provided by the maven (jar package by adding pom.xml).

    Therefore, in accordance with the previous paragraph description, our ultimate goal is to learn how to configure what we want to get a jar in pom.xml, before we have to understand how to create a maven project, maven project structure is how, and ordinary java, where the difference in the web project, and how to configure pom.xml get to the corresponding jar package and so on, here in advance to find out how we want to get to the jar by pom.xml files, depending more about this later this configuration file.

    pom.xml obtain written jar package junit of.

          

    Why you can locate a jar package through groupId, artifactId, version three properties?

        Added to the upper part of pom.xml file A project, A project is definitely a maven project, by the above three properties can be found junit jar corresponding version of the package, then the project is certainly a junit maven project, the junit maven project pom.xml file will have three identifiers, like the figure below this, then the project will be able to find other maven jar package junit projects through these three attributes. Therefore, in each maven project created will be asked to write these three property values.

          

Guess you like

Origin www.cnblogs.com/ren9ie/p/10962490.html