Maven多数据源的配置
近期遇到的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
这部分有待遇进一步补充,仅供参考