詳解idea maven nexus 常見命令配置
maven 常見命令配置
maven常用命令
#創(chuàng)建項(xiàng)目 -D設(shè)置參數(shù) mvn archetype:generate -DgroupId=cn.dwcode -DartifactId=dw.test.biz -Dversion=1.0.0 #創(chuàng)建項(xiàng)目 -B批處理模式構(gòu)建項(xiàng)目 mvn archetype:generate -B -DgroupId=cn.dwcode -DartifactId=dw.test.biz -Dversion=1.0.0 mvn clean mvn compile mvn test mvn package mvn install #-e詳細(xì)異常 -U強(qiáng)制更新 mvn compile -e -U #-P按配置打包 dev test pro 對于pom profiles mvn package -P dev #跳過測試 但是會編譯test mvn package -DskipTests #跳過測試 并且會編譯test mvn package -Dmaven.test.skip=true
注意:如果命令執(zhí)行失敗需要制定jdk版本
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> <java.version>1.8</java.version> </properties>
settings.xml
maven localRepository
<!--設(shè)置本地倉庫 --> <localRepository>D:\maven\repository</localRepository>
maven mirrors
<!--設(shè)置maven遠(yuǎn)程倉庫--> <mirrors> <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共倉庫</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors>
maven profiles
<!--設(shè)置maven配置,選擇設(shè)置不同的遠(yuǎn)程倉庫--> <profiles> <!-- 可按profile設(shè)置私有倉庫 --> <profile> <!-- id必須唯一 --> <id>nexus-repository-public</id> <repositories> <repository> <!-- id必須唯一 --> <id>public</id> <!-- 倉庫的url地址 --> <url>http://192.168.72.130:8081/repository/maven-public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles>
maven servers
設(shè)置maven deploy推送賬號密碼
<!--配置服務(wù)端的一些設(shè)置。一些設(shè)置如安全證書不應(yīng)該和pom.xml一起分發(fā)。這種類型的信息應(yīng)該存在于構(gòu)建服務(wù)器上的settings.xml文件中。--> <servers> <!--設(shè)置maven deploy推送賬號密碼 --> <server> <!--id與distributionManagement中repository元素的id相匹配。--> <id>nexus-releases</id> <!--鑒權(quán)用戶名。鑒權(quán)用戶名和鑒權(quán)密碼表示服務(wù)器認(rèn)證所需要的登錄名和密碼。 --> <username>admin</username> <!--鑒權(quán)密碼 。鑒權(quán)用戶名和鑒權(quán)密碼表示服務(wù)器認(rèn)證所需要的登錄名和密碼。密碼加密功能已被添加到2.1.0 +。詳情請?jiān)L問密碼加密頁面--> <password>123456</password> </server> </servers>
maven 完整配置
<?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"> <!-- 默認(rèn)的值是${user.home}/.m2/repository --> <localRepository>D:\maven\repository</localRepository> <!-- 如果Maven要試圖與用戶交互來得到輸入就設(shè)置為true,否則就設(shè)置為false,默認(rèn)為true。 --> <interactiveMode>true</interactiveMode> <!-- 如果Maven使用${user.home}/.m2/plugin-registry.xml來管理plugin的版本,就設(shè)置為true,默認(rèn)為false。 --> <usePluginRegistry>false</usePluginRegistry> <!-- 如果構(gòu)建系統(tǒng)要在離線模式下工作,設(shè)置為true,默認(rèn)為false。 如果構(gòu)建服務(wù)器因?yàn)榫W(wǎng)絡(luò)故障或者安全問題不能與遠(yuǎn)程倉庫相連,那么這個設(shè)置是非常有用的。 --> <offline>false</offline> <!--maven全局倉庫 --> <mirrors> <!-- <mirror> <id>nexus-public</id> <mirrorOf>central</mirrorOf> <name>NexusLocal</name> <url>http://192.168.72.130:8081/repository/maven-public</url> </mirror> --> <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共倉庫</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors> <!-- settings.xml中的profile是pom.xml中的profile的簡潔形式。 它包含了激活(activation),倉庫(repositories),插件倉庫(pluginRepositories)和屬性(properties)元素。 profile元素僅包含這四個元素是因?yàn)樗麄兩婕暗秸麄€的構(gòu)建系統(tǒng),而不是個別的POM配置。 如果settings中的profile被激活,那么它的值將重載POM或者profiles.xml中的任何相等ID的profiles。 --> <profiles> <!-- 可按profile設(shè)置私有倉庫 --> <profile> <!-- id必須唯一 --> <id>nexus-repository-public</id> <repositories> <repository> <!-- id必須唯一 --> <id>public</id> <!-- 倉庫的url地址 --> <url>http://192.168.72.130:8081/repository/maven-public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> <profile> <!-- id必須唯一 --> <id>aliyun-repository-public</id> <repositories> <repository> <id>public</id> <url>https://maven.aliyun.com/repository/public</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> <!-- activations是profile的關(guān)鍵,就像POM中的profiles,profile的能力在于它在特定情況下可以修改一些值。 而這些情況是通過activation來指定的。 --> <!-- <activeProfiles/> --> <!--配置服務(wù)端的一些設(shè)置。一些設(shè)置如安全證書不應(yīng)該和pom.xml一起分發(fā)。這種類型的信息應(yīng)該存在于構(gòu)建服務(wù)器上的settings.xml文件中。--> <servers> <!--設(shè)置maven deploy推送賬號密碼 --> <server> <!--id與distributionManagement中repository元素的id相匹配。--> <id>nexus-releases</id> <!--鑒權(quán)用戶名。鑒權(quán)用戶名和鑒權(quán)密碼表示服務(wù)器認(rèn)證所需要的登錄名和密碼。 --> <username>admin</username> <!--鑒權(quán)密碼 。鑒權(quán)用戶名和鑒權(quán)密碼表示服務(wù)器認(rèn)證所需要的登錄名和密碼。密碼加密功能已被添加到2.1.0 +。詳情請?jiān)L問密碼加密頁面--> <password>123456</password> </server> </servers> </settings>
idea常見配置
idea maven 配置
idea 刷新jar
idea 跳過測試
idea deploy配置
需要配置maven servers
pom.xml
<!--設(shè)置maven deploy倉庫--> <distributionManagement> <repository> <id>nexus-releases</id> <url>http://192.168.72.130:8081/repository/maven-releases</url> </repository> </distributionManagement> <build> <plugins> <!-- 要將源碼放上去,需要加入這個插件 --> <plugin> <artifactId>maven-source-plugin</artifactId> <version>3.2.1</version> <executions> <execution> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
idea profile選擇
idea 獲取jar循序
nexus 常見配置
nexus部署
#創(chuàng)建nexus數(shù)據(jù)目錄 mkdir -p /usr/local/work/nexus-data && chown -R 200 /usr/local/work/nexus-data #運(yùn)行模型 docker run -d \ -p 8081:8081 \ --name nexus \ -v /usr/local/work/nexus-data:/nexus-data \ sonatype/nexus3:3.19.1 #獲取初始密碼 echo `docker exec nexus cat /nexus-data/admin.password`
登錄:http://127.0.0.1:8081/
[外鏈圖片轉(zhuǎn)存失敗,源站可能有防盜鏈機(jī)制,建議將圖片保存下來直接上傳(img-yqXWZGBw-1618752330380)(idea_maven_nexus常見命令配置.assets\image-20210418211114096.png)]
nexus添加阿里云代理
阿里云配置:https://maven.aliyun.com/mvn/guide
nexus修改可更新
到此這篇關(guān)于idea maven nexus 常見命令配置的文章就介紹到這了,更多相關(guān)idea maven nexus命令配置內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Java基礎(chǔ)學(xué)習(xí)筆記之?dāng)?shù)組詳解
這篇文章主要介紹了Java基礎(chǔ)學(xué)習(xí)筆記之?dāng)?shù)組,結(jié)合實(shí)例形式詳細(xì)分析了java的基本概念、定義、迭代、輸出、反轉(zhuǎn)、排序等常用操作技巧,需要的朋友可以參考下2019-08-08淺談java項(xiàng)目與javaweb項(xiàng)目導(dǎo)入jar包的區(qū)別
下面小編就為大家分享一篇淺談java項(xiàng)目與javaweb項(xiàng)目導(dǎo)入jar包的區(qū)別,具有很好的參考價(jià)值。希望對大家有所幫助。一起跟隨小編過來看看吧2017-11-11Spring中的@ControllerAdvice三種用法詳解
這篇文章主要介紹了Spring中的@ControllerAdvice三種用法詳解,加了@ControllerAdvice的類為那些聲明了(@ExceptionHandler、@InitBinder或@ModelAttribute注解修飾的)方法的類而提供的<BR>專業(yè)化的@Component,以供多個Controller類所共享,需要的朋友可以參考下2024-01-01簡單了解java volatile關(guān)鍵字實(shí)現(xiàn)的原理
這篇文章主要介紹了簡單了解volatile關(guān)鍵字實(shí)現(xiàn)的原理,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-08-08PL/SQL實(shí)現(xiàn)JAVA中的split()方法的例子
這篇文章主要介紹了PL/SQL實(shí)現(xiàn)JAVA中的split()方法的例子的相關(guān)資料,非常不錯,具有參考借鑒價(jià)值,需要的朋友可以參考下2016-07-07使用MAT進(jìn)行JVM內(nèi)存分析實(shí)例
這篇文章主要介紹了使用MAT進(jìn)行JVM內(nèi)存分析實(shí)例,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-04-04使用JDBC連接Mysql 8.0.11出現(xiàn)了各種錯誤的解決
這篇文章主要介紹了使用JDBC連接Mysql 8.0.11出現(xiàn)了各種錯誤的解決,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-08-08詳解@ConfigurationProperties實(shí)現(xiàn)原理與實(shí)戰(zhàn)
這篇文章主要介紹了詳解@ConfigurationProperties實(shí)現(xiàn)原理與實(shí)戰(zhàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-10-10