MAVEN's usage Experience

Source: Internet
Author: User

As a result of the previous transfer from the C + + code camp to the Java camp (this may also be transferred to the Scala camp). When writing engineering code, it's also possible to simply create Java project. However, as the project grows, the number of components is increasing and the number of dependent packages that need to be maintained is very great. However, it is important here to look at the source code (especially for open source projects). When you need to view the source code for a problem, if you are just to create a simple Java Project project, then you want to view the source of the dependent package, you must add the corresponding dependency package in the build path source path can be viewed, and if you have downloaded the corresponding source code. In this way, as the number of dependent packages increases, you need to manually add each one, which is quite a hassle. So is there a better way? The answer, of course, is yes, and that is with Maven.

At first you don't understand Maven and may feel like you don't know how to add a dependency package. Yes, yes. There are a lot of maven-related tutorials on the web, but I've found that I've read some tutorials and still don't understand. No way, only continue to bite the bullet, hands-on. By writing a simple program, and the program relies on other packages. There are some problems with my IDE (Eclipse) in this process.

1. IDE

Since MAVEN is now integrated into the corresponding eclipse. Therefore, you do not need to download the plugin installation, the eclipse is already integrated, all you need to do is to create MAVEN project. But when creating Maven project, there were a few minor problems:

In some of the online tutorials, when you create Maven project, you will immediately have the following directories:

    

Oddly enough, I didn't have maven dependencies in the red box when I was creating Maven project. So bothered me for a long time, and constantly on-line search information. Time passes, and when I look back at the IDE, I inadvertently find that there's a corresponding Maven dependency in eclipse. Carefully, originally it will automatically download the corresponding jar package and generate the corresponding Maven dependency, just start to create the time because there is no corresponding dependency package, so it does not display, with a dependency package will be downloaded automatically and displayed.

2. Tips for adding dependent packages

For Maven, the main job is to know what dependencies to add, and how do you know what dependencies you need to add to the package?

The way is: Google.

But Google is also skilled, for example, in your project, you need to add a dependency package, first of all you must know the corresponding dependencies of the keyword, so long can be directly to Google in the following way to search:

          Maven Dependency Package keyword dependency

The result is often the first one.

These dependencies, MAVEN will automatically help you to download the corresponding source code and documents, only need to be in the IDE simple settings. In Eclipse: Window------>preferences------A few options appear on the right side of the >maven to the three hooks.

MAVEN's usage Experience

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.