亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

詳解Maven環(huán)境的搭建與idea配置

 更新時(shí)間:2017年12月01日 10:11:03   作者:xxb2008  
本篇文章主要介紹了詳解Maven環(huán)境的搭建與idea配置,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

本文主要介紹了Maven環(huán)境的搭建與idea配置,分享給大家,具體如下:

Maven 下載: http://maven.apache.org/download.cgi

Maven 中央倉庫地址:http://search.maven.org

配置maven環(huán)境變量

M2_HOME:D:\workspace\maven\apache-maven-3.0.5

Path:;%M2_HOME%/bin;

檢查是否成功,打開CMD:

Mvn -v

mvn install 會(huì)將項(xiàng)目生成的構(gòu)件安裝到本地Maven倉庫

mvn deploy 用來將項(xiàng)目生成的構(gòu)件分發(fā)到遠(yuǎn)程Maven倉庫

D:\>mvn archetype:generate:在D:盤構(gòu)建maven標(biāo)準(zhǔn)項(xiàng)目目錄結(jié)構(gòu)

2、settings.xml文件配置

2.0修改本地倉庫位置

M2_home目錄下 conf/settings.xml

<localRepository>D:/workspace/maven/stone</localRepository> 

2.1如何配置遠(yuǎn)程倉庫(私服): (nexus-2.0.4-1-bundle)

<profiles> 
  <profile> 
    <id>nexus</id> 
    <repositories><!--配置遠(yuǎn)程倉庫--> 
      <repository> 
        <id>nexus</id> 
        <name>Central Repository</name> 
        <url>http://127.0.0.1/nexus/content/groups/public</url> 
        <releases> 
          <enabled>true</enabled> 
        </releases> 
        <snapshots> 
          <enabled>false</enabled><!----> 
        </snapshots> 
      </repository> 
    </repositories> 
    <pluginRepositories><!--配置Maven從什么地方下載插件構(gòu)件--> 
      <pluginRepository> 
        <id>nexus</id> 
        <name>Central Repository</name> 
        <url>http://127.0.0.1/nexus/content/groups/public</url> 
        <releases> 
          <enabled>true</enabled> 
        </releases> 
        <snapshots> 
          <enabled>false</enabled> 
        </snapshots> 
      </pluginRepository> 
    </pluginRepositories> 
  </profile> 
</profiles> 
 
<activeProfiles><!--激活 遠(yuǎn)程倉庫--> 
    <activeProfile>nexus</activeProfile> 
</activeProfiles> 

2.2還可以配置倉庫的鏡像下載

<mirrors> 
<mirror><!--配置鏡像--> 
  <id>nexus</id> 
  <mirrorOf>*</mirrorOf> 
  <url>http://127.0.0.1/nexus/content/groups/public</url> 
</mirror> 
</mirrors> 

3、pom.xml文件配置依賴

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
  <modelVersion>4.0.0</modelVersion> 
  <groupId>xu.feifei</groupId> 
  <artifactId>feifei</artifactId> 
  <packaging>war</packaging> 
  <version>1.0</version> 
 
  <dependencies> 
 
    <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
      <scope>test</scope> 
    </dependency> 
    <dependency> 
      <groupId>org.json</groupId> 
      <artifactId>json</artifactId> 
      <version>20090211</version> 
    </dependency> 
 
  </dependencies> 
 
  <build> 
    <finalName>feifei</finalName> 
  </build> 
   
</project> 

二、IDEA的搭建Maven相關(guān)配置

.

maven項(xiàng)目的包結(jié)構(gòu)

設(shè)置maven自動(dòng)導(dǎo)包



以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論