maven installation configuration + myeclipse2017 create a maven project configuration +

1 download apache-maven-3.3.9 and extract
2 maven configure the environment variable
(1) New variable in the System variables field
MAVEN_HOMEbianliang
Path editing system variables (2), added at the end;% MAVEN_HOME% \ bin (note the semicolon)
Here Insert Picture Description
(3) cmd, command line input mvn -v, i.e., the results appear below success environment variable configuration
Here Insert Picture Description
3 connection warehouse modify maven local repository
open the file conf apache-maven-3.3.9 in the extraction path in the settings.xml
Here Insert Picture Description
. 4 in MyEclipse Configuring maven
Window-> Preferences-> Manven, follow these steps to configure
Here Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture Descriptionthe above will be configured to myeclipse maven, you can create a new maven project engineering write it.
5 myeclipse quickly create a maven project
myeclipse right new-> other-> Maven project
Here Insert Picture Description
Here Insert Picture Description
if selected web project, created after the completion of the project due to lack of web.xml, pom.xml error
Here Insert Picture Description
create a folder in src-> main-> webapp WBE- INF, create a web.xml file
Here Insert Picture Description
web.xml file as follows

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>crm</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

</web-app>

Finally, right-click the project name -> maven-> update maven project click OK on it.

Released three original articles · won praise 1 · views 95

Guess you like

Origin blog.csdn.net/L36_2587/article/details/104412133