建立maven項目,配置maven地址

  1. 在eclipse中,新建maven項目
  2. next第二步,選擇webapp
  3. 輸入id及包名,完成新建
  4. 給項目build path,添加1.8版本jdk和tomcat
  5. 項目右鍵屬性 project Facets,切換成web項目,配置資源文件路徑爲src/main/webapp
  6. 修改eclipse的maven配置文件,properties-maven-user settings
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
 
  <localRepository>C:\Users\Ocean\.m2\repository</localRepository>
  <mirrors>
  <mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
</settings>

下面的是配置阿里巴巴的maven倉庫,享受快速加載,感謝阿里!web

<mirror>
       <id>nexus-aliyun</id>
       <mirrorOf>*</mirrorOf>
       <name>Nexus aliyun</name>
       <url>http://maven.aliyun.com/nexus/content/groups/public</url>
   </mirror>
相關文章
相關標籤/搜索