[Java,maven] using MAVEN to build a simple netty development environment

Source: Internet
Author: User



The general process is:

First, use the MVN command to create a simple set of Java packages below the specified path.

Then, use Jidea to import the MAVEN project to load the created package into the IDE environment. ‘

Next, modify the Pom.xml file in the IDE environment, under the associated tag, depending on the needs,Writes the value of the latest version of Netty.

The Netty Series function package is then detected in the. java file by invoking the import statementis successfully loaded into the current project's development environment.

The specific process is described as follows:

1. First ensure that MAVEN is properly installed in the system and that the Java version in the current systemThe,IfIf not installed,
You can see the article:http://blog.chinaunix.net/uid-28595538-id-5086987.html

2. Next, let's use the MVN command line to generate a simple package under the specified path mavenDifferent required java-Project packages are generated based on the different parameter options of the user Input command.
java-packages required to develop a dedicated website, there are many other kinds of, we choose the simplest here, that is, when MVN creates the package, select all the default options.
(that is, do not choose, or create a more complex file project package, the basis for modification will become impossible)

[command] mvn Archetype:generate-dgroupid=org.kokia-dartifactid=netty-frame-demo

Where archetype:generate corresponds to what MVN is going to do is the command to create the java-project package.
-dgroupidcorresponding to the package name of the project after creation, if you are using Org.kokia, then using the custom-written Test class in other projects is required
Via Import org.kokia.Test; Method introduced by

-dartifactidThe name of the corresponding created project, that is, if the MVN command executes successfully, then a name is generated under the current directory named
' Netty-frame-demo' The General java-project package.

3. Import the project package you just generated into the Java-idea, as shown in the following procedure

Choose New---Module from Existing Sources
















4. OK, now the project package has been imported into the IDE development environment, we have to modify the Pom.xml file, in the dependency tag,
Write requirements for Netty software according to certain format requirements. Java-idea automatically downloads the corresponding resources from the Internet according to the Pom.xml file.
and store the resource in a local repository, and on my computer, MAVEN's repository path is located below/root/.m2/


5. After performing the above operation, you will find a progress bar to download the Netty package under the IDE, and when it is complete, we open the
Src/main/app.java, in the package .... Write a line below

Import Io.netty.bootstrap.Boostrap;

The statement detects the compilation statement, detects whether the compilation environment will be an error, if not error, it means that the Netty package has been successfully introduced into the project development environment by modifying the Maven file.



add 6/21
If you want to increase spring-framework dependency,

Click ( here ) to collapse or open

  1. <dependency>
  2.        <groupid>org. Springframework< /groupid>
  3.        <artifactid>spring- context</artifactid>
  4.        <version>3. 1. 1. Release</< Span style= "color: #ff0000; font-size:12px; " >version>
  5.     < /dependency>
ide will automatically download the corresponding version of the package from the official website "org.springframwork" and load it into the current project
end

[Java,maven] uses MAVEN to build a simple netty development environment

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.