Maven书签

谁说胖子不能爱 提交于 2019-12-14 11:48:05

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

maven

星期天整理书签之 maven

删除所有 lastUpdated 文件

包含.jar.lastUpdated 和 .pom.lastUpdated,以下操作等价随便选一条执行即可

~/.m2/repository$ find ~/.m2 -name "*lastUpdated" -exec rm -rf {} \;

~/.m2/repository$ find ~/.m2 -name \*lastUpdated -exec rm -fv {} +;

~/.m2/repository$ find ~/.m2 -name \*lastUpdated -delete;

~/.m2/repository$ find ~/.m2 -name \*lastUpdated | xargs rm -fr;

windows 下删除 lastupdate 的方法

@echo off
echo 开始...
for /f "delims=" %%i in ('dir /b /s "./*lastUpdated"') do (
    del /s /q %%i
)
echo 结束
pause

参考:
批量删除Maven 仓库未下载成功.lastupdate 的文件 - Phoenix-Smile - 博客园
maven-downloads-have-lastupdated-as-extension

国内环境配置镜像仓库

配置 aliyun 作为镜像仓库 settings.xml

  <mirrors>
	<mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </mirror>
	<mirror>
      <!--This is used to direct the public snapshots repo in the 
          profile below over to a different nexus group -->
      <id>nexus-public-snapshots</id>
      <mirrorOf>public-snapshots</mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
    </mirror>
  </mirrors>

参考:
仓库服务
国内已经没有maven镜像站了吗? - 知乎
aliyun maven - jis117 - 博客园

maven 多模块项目,编译打包指定模块

mvn package -pl ms-eureka -am
mvn package -pl ms-zuul -am

参考:
Maven多个mudule只编译、打包指定module

maven 相关的问题

  1. List the differences between ANT and Maven.
  2. What does it mean when you say Maven uses Convention over Configuration?
  3. What is the Maven Build lifecycle?
  4. Is it possible to refer a property defined in your pom.xml file

参考:
Top 50 Maven Interview Questions You Should know In 2020 | Edureka

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework. The development team is easily able to automate the project’s build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!