近期遇到的maven問題
1.多數據源配置,始終只有一個maven庫下載
2.打包過程中遇到的問題
多數據源配置,以及IDEA上的配置
每打開一個項目請先確認,setting>maven>設置是本地maven配置還是
自帶的配置,如果是自帶的配置,請修改為你自己配置過的配置文件目錄。
看一下setting.xml內比較重要的幾個位置
1.指定本地倉庫位置
2.指定是本地jdk這些內容
3.多個源配置內的,id一定不能相同,mirrorOf位置配置為centeral,不能
配置為,配置為會默認只訪問這個源,不會切換下一個源
如果maven包下載不下,打開項目刪除.idea等無關文件
配置文件代碼展示
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<localRepository>D:\\env\\resp</localRepository>
<mirrors>
<mirror>
<id>aliyun</id>
<mirrorOf>central</mirrorOf>
<name>maven.aliyun.com</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>crespo1</id>
<mirrorOf>central</mirrorOf>
<name>maven.aliyun.com</name>
<url>http://repository.cloudera.com/artifactory/cloudera-repos/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
</settings>
打包問題
mvn clean package 你的項目模塊 -am -Pcdp -DskipTests=true
這部分有待遇進一步補充,僅供參考