IntelliJ Creating a MAVEN Web project

Source: Internet
Author: User

1. Configure Mavne, select the location of your own installed Maven, configuration file, local repository, respectively.

2. Create a new project and select the MAVEN project. (file-"New project-" maven). Select it as shown in the red box.

Here is created based on the existing Mavne Template Library, we chose Archetype-webapp, which is the simplest web template.

3. Fill in the groupid,artifacid (the meaning of the specific parameters, MAVEN configuration file is relatively clear, will not repeat)

4. Configure the project MAVEN configuration

Here reference http://mark.leanote.com/post/%E4%BD%BF%E7%94%A8IntelliJ-IDEA-14%E5%92%8CMaven%E5%88%9B%E5%BB%BAjava-web%E9 %a1%b9%e7%9b%ae

Specific explanations:

Here, adding a parameter archetypecatalog=internal to the properties, without this parameter, will be very slow when Maven builds the skeleton, and sometimes it will get stuck directly. (Important!!! )

Explanations from the Internet:

Archetypecatalog represents the plug-in uses the archetype metadata, does not add this parameter when the default is Remote,local, that is, the central warehouse archetype metadata, because the central warehouse archetype too much, so the result is very slow, Specify internal to indicate that only internal metadata is used.

5. Fill in the project name and other basic information, here is relatively simple.

After completion the project is as follows:

6. In the main directory, create a new Java directory as the root directory of the code


7. Set Item has property item right-click Open Module settings  (1) Set the module source property to set the Java directory to source, as the code root directory set the resources directory to resource, As the root directory for resources. After the Resouces directory is published on the website, the files under the Resouces directory are in the Web-info directory.    (2) Set the Path property here the path is that the project in the compiled file location, and the following artifacts inside the path to distinguish between, that path is the site's content publishing path.    (3) Add tomcat and JDK dependencies. MAVEN's dependencies are automatically configured, and all MAVEN-dependent libraries will automatically appear in the dependencies here.   8. Add a Web facets (the default is already added, if not, you need to add it yourself) if you add it yourself, confirm that the two-box position is correct. Web moudule Deployment Descriptor: Select Webapp/web-info/web.xml File Web resource dictory: Select the WebApp directory as the root directory.   9. Set the configuration of the articifacts, which is clearly described in the figure. It is important to mark the words, if there is a problem, confirm that each place is configured, it is important to understand the reasons for these configurations, and the relationship between multiple configurations.   10. Add Tomcat sever for publishing and running the site   (1) Add deploy Artificat, choose exploded the specific war exploded of the difference self-query, simple when the war is a packed compressed version of the website, Exploded is an unpacked version. (2) Configure the properties of the sever first: Choose the location of the Tomcat you installed second: Add  -DFILE.ENCODING=UTF-8 encoding configuration, avoid the console Chinese garbled third place: Make sure this is Make+build, Otherwise, you may not find a artifiate error. (The difference between make build refers to: http://www.php-note.com/article/detail/848)  11. Run the compiled file will appear in target, test is the content of our publishing site, if the site is running a problem, check hereFiles and whether they are expected to conform, if not, so long is the compilation or Web factes configuration problems, you can refer to the previous steps to check.    successfully appeared hello world 11. References and related useful links
    1. Intellij the difference between compile, make and build in the Idea 14.x menu item: http://www.php-note.com/article/detail/848
    2. Intelli Integrated tomcat:http://www.php-note.com/article/detail/854 (there are several links are also good articles)
    3. English garbled: http://www.it610.com/article/3575024.htm http://wiki.jikexueyuan.com/project/intellij-idea-tutorial/ Theme-settings.html (This article differs in that the/.IDEA/ENCODINGS.XM file is modified to ensure that the project is encoded)

IntelliJ Creating a MAVEN Web project

Related Article

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.