IDEA build maven (on)

IDEA build maven

1. Download the archive maven

         a. Enter the URL www.apache.org

        

 

         b. Pull down, came to the following screen, click maven

 

 

c. Click Download

 

 

d. Click to download

 

 

e. the following documents

 

 

2. Extract the archive maven

         a. the following directory

 

 

b. Create a local repository folder MavenRepository

 

 

c. Open the conf folder inside settings.xml file modification

 

 

d. adding a node, the path is the path just new local repository folder

 

 

e. modified library download path

 

 

3. Configure maven environment variables

a. Open the interface environment variables (do not know how open you can click on the following link here is not to describe)

https://jingyan.baidu.com/article/86112f137c432c2736978774.html

        

 

         b. adding a variable M2_HOME, the path is a path maven

          

 

         c. Modify the path of increased bin path maven

        

 

         d. detecting environment variable is configured correctly

 

 

 

 

The first step: modify the configuration file

winrar open the zip file

D:\MavenRepository\org\apache

\maven\archetypes\maven-archetype-webapp\1.0\

maven-archetype-webapp-1.0.jar

To the web.xml (version 3.1, 4.0, 3.0 or the like) covering \ web.xml \ src \ \ webapp \ WEB-INF under the main archetype-resources inside (2.3)

 

Step Two: Create a project manual command

  1. Creates a normal java project:

mvn archetype:generate -DgroupId=com.nf -DartifactId=cc1 -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

 

maven-archetype-quickstart是普通java项目的模板

 

 

  1. 创建J2EE的web项目:

方案一:修改上面项目的pom.xml,把<packaging>jar</packaging>改为<packaging>war</packaging>,然后新建目录src\main\webapp\WEB-INF和文件web.xml

 

方案二:

mvn archetype:generate -DgroupId=com.nf -DartifactId=cc2 -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

 

 

 

 

 

第三步:给tomcat添加用户信息

 

 

 

 

 

 

 

第四步:配置maven,添加tomcat登录信息。让maven可以直接操作tomcat。

 

 

 

第五步:配置具体项目

例如cc2项目

 

 

 

 

 

 

 

 

 

 

 

        

 

 

        

        

Guess you like

Origin www.cnblogs.com/su2657078260/p/11005858.html
Recommended