Maven使用命令mvn clean install 不从远程仓库拉取jar文件
现象描述:
项目是多模块的,使用mvn clean install 想编译一下。发现不从公司的私有仓库拉取文件。导致编译不通过。第一时间觉的是远程仓库配置的有问题。所以去找到setting.xml文件查看。但是发现远程仓库配置是正确的呀。到最后才发现是activeProfiles的问题。把这个注释打开就好了。真是.....
<!--这个之前是注释掉的--> <activeProfiles> <activeProfile>nexus</activeProfile> </activeProfiles>
部分配置如下:
<profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <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> <profile> <id>nexus</id> <repositories> <repository> <id>nexus</id> <name>Nexus</name> <url>http://nexus.xxx.xxx/repository/public</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>Nexus</name> <url>http://nexus.xxx.xxx/repository/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> </profile> <activeProfiles> <activeProfile>nexus</activeProfile> </activeProfiles>
参考:
分类:
Maven
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· winform 绘制太阳,地球,月球 运作规律
· 上周热点回顾(3.3-3.9)
2018-02-23 Filter的执行顺序