IntelliJ Idea 12.0 Set up the MAVEN Web SSH2 Architecture Project Example (resolve the card dead problem) _idea

Source: Internet
Author: User
After this blog post for a period of time, I think some places to write is not appropriate, today to change, and strive for perfection. Using idea to build a MAVEN Web project can be very uncomfortable for many people who are accustomed to eclipse. Eclipse and idea do differ in the project's directory structure settings. This article will be described in more detail on the original basis, and finally two examples will be given to show the actual effect. The article will be introduced from 5 aspects: (article map more, if you can not show, here is the PDF document, content)
1. The Foundation environment constructs;
2. Create a maven-web-application application;
3. Introduction of an existing Maven-web-application project;
4. Environmental configuration and implementation of debugging;
5.maven-web-application Project core Document: The structure analysis of pom.xml documents.

1. The Foundation Environment constructs
First of all, install the JDK in your environment and configure the system variable (S) as shown in the following diagram when configuring environment variables. The following figure

Create a new variable java_home and do not make a non-mainstream configuration of the environment. When this step is complete, edit the system variable path, as shown in the following figure:
to join in;%java_home%\bin;
After all save, open the Cmd interface, enter the command: Java-version, if the following is displayed the Java environment configuration is successful.

Now let's start configuring Maven. MAVEN is the Magic tool that has the latest information about the project under Apache, and his connection address is as follows: HTTP://MAVEN.APACHE.ORG/DOWNLOAD.CGI now the latest version is Maven 3.1.1. As shown in the following figure, we select the file in the red box and download it.

After decompression, I put him in the D:\Program file\apache-maven-3.1.1-bin\apache-maven-3.1.1 directory. It is not necessary to follow your preference here. Now start configuring the M2_home variable, as shown in the following illustration:


The value of the variable is: D:\Program file\apache-maven-3.1.1-bin\apache-maven-3.1.1. When you are done, edit the path variable again, as shown in the following illustration:
Open cmd again, and note that this closes the last window. Enter the command as follows: Mvn-v carriage return. If the following image interface appears, your MAVEN environment variable configuration is successful.

2. Create a maven-web-application application
On top of that, this assumes that you first installed IntelliJ idea in a Windows system. My system is the Windows 7 flagship, note: My operating system does not jump to administrator privileges, my login name is YANGCL, not administrator. I suggest that if you jump as an administrator it's best to reload the system, because in the back of the debug project, idea would have been unable to find the third party jar package you relied on because it could not find the. M2 folder, which would cause your project to run out of order, as many people asked me. This question was not noticed in the first time this blog was written and presented today.
Opening idea for the first time, as shown below, we create a maven-web-application project from scratch.


Select "Create New Project" to show the following image interface


When you are finished, click the Finish button. And then idea pops up the interface shown in the following image:


When we are done, we begin to create a new moudle, as shown in the following figure:



Select "Maven Module" in the new window.


After the click is complete, the following interface appears, paying attention to where the red squares are circled. The following figure:


If you use a remote repository to support your project, the following interface is completely unchanged.


When clicked, your C:\Users\Yangcl\.m2\repository folder should have some dependencies downloaded, and your idea console is also starting to download and look for dependencies. Note: These are the idea of automatic execution. The following 2 pictures:



Such a simple Maven-web-application project was created, as shown in the following 2 images:




As you can see, there is no other content under the red box. Because we want to use this project to build a SSH2 program, we have to change the Pom.xml file and add more things to it such as dependencies and compilation paths (<dependencies >, < build >), The following will be a separate piece to introduce Pom.xml, here simple as shown:


After adding <dependencies > The compiler will display an error because there is no reimport, as shown in the following figure:


At this point, a project with a SSH2 base depends on the environment. If you want to delete this item, don't do it as you did in Eclipse, you can follow the diagram below:






So the project is deleted. The article is too long, and the rest is described in the IntelliJ idea 12.0, a maven Web SSH2 Architecture Project Example (ii).

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.