詳解Maven環(huán)境的搭建與idea配置
本文主要介紹了Maven環(huán)境的搭建與idea配置,分享給大家,具體如下:
Maven 下載: http://maven.apache.org/download.cgi
Maven 中央倉(cāng)庫(kù)地址: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倉(cāng)庫(kù)
mvn deploy 用來(lái)將項(xiàng)目生成的構(gòu)件分發(fā)到遠(yuǎn)程Maven倉(cāng)庫(kù)
D:\>mvn archetype:generate:在D:盤構(gòu)建maven標(biāo)準(zhǔn)項(xiàng)目目錄結(jié)構(gòu)
2、settings.xml文件配置
2.0修改本地倉(cāng)庫(kù)位置
M2_home目錄下 conf/settings.xml
<localRepository>D:/workspace/maven/stone</localRepository>
2.1如何配置遠(yuǎn)程倉(cāng)庫(kù)(私服): (nexus-2.0.4-1-bundle)
<profiles>
<profile>
<id>nexus</id>
<repositories><!--配置遠(yuǎn)程倉(cāng)庫(kù)-->
<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)程倉(cāng)庫(kù)-->
<activeProfile>nexus</activeProfile>
</activeProfiles>
2.2還可以配置倉(cāng)庫(kù)的鏡像下載
<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)包



以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
java中處理json各種各樣的轉(zhuǎn)換方法(推薦)
下面小編就為大家分享一篇java中處理json各種各樣的轉(zhuǎn)換方法小結(jié),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來(lái)看看吧2017-11-11
第一次使用Android Studio時(shí)你應(yīng)該知道的一切配置(推薦)
這篇文章主要介紹了第一次使用Android Studio時(shí)你應(yīng)該知道的一切配置(推薦) ,需要的朋友可以參考下2017-09-09
編譯大型Java項(xiàng)目class沖突導(dǎo)致報(bào)錯(cuò)的解決方案
這篇文章給大家盤點(diǎn)編譯大型項(xiàng)目class沖突導(dǎo)致報(bào)錯(cuò)的解決方案,文中通過代碼示例介紹的非常詳細(xì),具有一定的參考價(jià)值,需要的朋友可以參考下2023-10-10
java抓取鼠標(biāo)事件和鼠標(biāo)滾輪事件示例
這篇文章主要介紹了java抓取鼠標(biāo)事件和鼠標(biāo)滾輪事件示例,需要的朋友可以參考下2014-05-05
快速搭建Spring Boot+MyBatis的項(xiàng)目IDEA(附源碼下載)
這篇文章主要介紹了快速搭建Spring Boot+MyBatis的項(xiàng)目IDEA(附源碼下載),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-12-12
java實(shí)現(xiàn)停車場(chǎng)管理系統(tǒng)
這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)停車場(chǎng)管理系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-11-11
Servlet的5種方式實(shí)現(xiàn)表單提交(注冊(cè)小功能),后臺(tái)獲取表單數(shù)據(jù)實(shí)例
這篇文章主要介紹了Servlet的5種方式實(shí)現(xiàn)表單提交(注冊(cè)小功能),后臺(tái)獲取表單數(shù)據(jù)實(shí)例,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2017-05-05

