maven-metadata.xml

maven server Downloading The latest maven-metadata.xml file can be regarded as version information. As a version comparison, compare it with the maven-metadata-local.xml in the jar package folder in the local warehouse (.m2/repository). Look at the lastUpdated timestamp value, which value is larger?

找到本地的maven配置文件settings.xml,打开后找到下面:
 <repository>
    <id>snapshots</id>
    <name>Snapshots</name>
    <url>url</url>
    <releases>
     <enabled>false</enabled>
    </releases>
    <snapshots>
     <enabled>true</enabled>
     <updatePolicy>always</updatePolicy>
    </snapshots>
 </repository>

Find the updatePolicy tag in xml and change it to never.
<repository>
    <id>snapshots</id>
    <name>Snapshots</name>
    <url>url</url>
    <releases>
     <enabled>false</enabled>
    </releases>
    <snapshots>
     <enabled>true< /enabled>
     <updatePolicy>never</updatePolicy>
    </snapshots>
   </repository>
After making the changes, you will not download the maven-metadata.xml file when you go to build. You can change it according to your needs. This attribute is the update strategy, aways: every time, never: never, daily: every day.
 

Guess you like

Origin blog.csdn.net/yz18931904/article/details/130910033