Maven learning notes, maven Learning

Source: Internet
Author: User

Maven learning notes, maven Learning

Looking at the blog garden's essays, I did not write anything for a month, not to say that I didn't learn or have encountered any problems. In the final analysis, it was still caused by inertia. I still have to make changes to laziness. I have to keep writing in the future. Maybe it will be useful someday? As a great god in the garden said, maybe one day a blog is a necessity for an interview?

Okay, I don't have to talk about it anymore. I started to get started with an open-source project earlier, but I didn't understand the structure of the project at first glance, and I didn't use ant either, I do not know that maven is a thing, so I had to worry about it. Later I asked du Niang to know that this is maven. So what is maven?

Du Niang's answer is: Maven is a software project management tool based on the project Object Model (POM). You can use a short description to manage project building, reporting, and documentation. In addition to program building capabilities, Maven also provides advanced project management tools. Because Maven's default build rules are highly reusable, it is often possible to build a simple project using two or three lines of Maven build scripts. Due to Maven's project-oriented method, Many Apache Jakarta projects use Maven when publishing documents, and the proportion of Maven used by the company's projects continues to grow.

Du Niang's answer is always high-end, but I don't know what it means if I have never used anything higher. So today I downloaded maven and configured the environment, I simply used it. The first thing I felt was that "Mom never worried that I didn't have a JAR package". For example, in the past, when writing a JDBC link, you still need to download a JAR package connecting to the database. This should be useful, but sometimes you cannot find a JAR package for half a day, it's hard to download a version that was a long time ago (Of course someone will say that the landlord is stupid, this is... It is really stupid, haha), but with maven installed, as long as you connect to the network, you only need a few lines of code to download the JAR package you need from the central library.

The convenience of adding a JAR package is one of the advantages of maven. I think another advantage is that the structure is clear, the main package contains the main code, and the test code in the test package. This gives me the feeling that it is clear and convenient, however, it is difficult to use it at the beginning, but the structure of the project is clear. Secondly, you can use maven not only to package your project into a jar, but also to package your project into a war. Is it very convenient.

It took only one day, so other advantages were not found for the moment, and the findings may be inaccurate. Therefore, we hope that you will give us some advice on misexpressions.

In fact, after talking nonsense for a long time, everyone must think that my essay is over... Sorry, I want to record maven installation, Environment configuration, and simple use.

First, install it. After the download, you can find a location to decompress it. The main user is used to putting the software on the D disk, so after decompression, It is D: \ maven. Open the folder and you can see these files. The bin folder stores the executable commands of maven, and lib stores some class libraries required by maven, such as boot, amount, and forget, but it doesn't matter if you don't know, the last one is conf, which must be remembered. This is the directory for saving the configuration file, which contains settings. xml files are useful.

Next, configure the environment. My computer ----> properties ---> advanced system settings ----> environment variable ----> Create M2_HOME -------> the value is D: \ maven. If you do not want to enter the full path of maven every time, configure it in path, open D: \ maven \ bin, copy the path to the end of path, and don't forget the semicolon.

After the environment is configured, you can use it. win + r Enter cmd, open it, enter mvn-v, and check the result. If your maven version can be displayed, congratulations, your maven has been installed.

Well, today we talk about a bunch of things. For now, let's continue tomorrow. If you have any questions, please let us know. Another question is: which forum should I publish this article? I am engaged in java, so I often get stuck in java.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.