The project I am currently working on is using MAVEN to manage jar packages. This is also my first time to get involved in maven. I feel very good. I no longer have to add and download jar packages one by one. Just configure it in the maven configuration file. maven can help us download automatically. Very convenient. I was busy before and didn’t have time to sort it out. Now I sort it out and record it to deepen my impression. Of course, our use of maven is only the most basic, and many other functions have not been used. This article only introduces how to create a maven project, not other things.
Refer to the previous blog post for environment construction: //www.VeVB.COM/article/131269.htm
The following are two websites for maven to find jar package configuration. You only need to search for keywords to find the required Jar package. It is very convenient, such as: mysql to find mysql-connect-java.jar.
http://search.maven.org/#search%7Cga%7C1%7Cmybatis
http://mvnrepository.com/
The following are the relevant graphic tutorials created:
1. First create a new maven project and see the picture:
2. Follow the above steps to create a maven project. You can see the directory structure in the figure below, but such a directory structure is wrong and some modifications are required.
First of all, in order to avoid garbled code, we should replace the project encoding with UTF-8. In the future, the project encoding will use UTF-8, and add a character encoding filter, so the garbled code will no longer be "chaotic" (it does not mean there is no, but it is easier to solve).
Again, follow the following diagram (set JRE as default), so that a complete and correct directory structure will appear. As for the reason, I am not very clear, it should be a bug:
Finally, there is an index.jsp error, we need to introduce the jar package of java ee. Introduced in pom.xml:
<!-- Import java ee jar package --> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> </dependency>
At this point, the complete directory structure and the correct project are done. Next, we will make some configurations. After all, it is a web project, and requires jstl, etc. The configuration is as follows:
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.