About the new dependency on private repositories

Because I was not familiar with it before, I thought that I could directly install < Repositories > in the POM file as usual. The first time I uploaded an error, and then I was told that I need to put the dependency into the private repository, so I put the dependency into the private repository, but when I rerouted the code, I still got an error, as shown below

[ERROR] Failed to execute goal on project ime-common: Com. IME: IME-common :jar: 0.0.1-snapshot: The following artifacts could not be resolved: Com. Youzan. Cloud: open - SDK - core: jar: 1.0.7 - RELEASE, com. Youzan. Cloud: open - SDK - gen: jar: 1.0.22.80056202107020904 - RELEASE: A Failure to find com. Youzan. Cloud: open - SDK - core: jar: 1.0.7 - RELEASE in https://nexus.cnjiang.com/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of cnjiang-nexus has elapsed or updates are forced -> [Help 1]

Maven builds projects with locally cached libraries by default. For libraries that failed to download last time, Maven creates the XXX. LastUpdated file in ~/.m2/repository/<group>/<artifact>/<version>/. Once the file exists, the dependent library will not be updated until the next Nexus update.

The solution

1. Remove the *. LastUpdated file in v~/.m2/repository/<group>/<artifact>/<version>/ and run the MVN compile project again. , but without permission.

2. Modify the ~ /. M2 / Settings. The XML or/opt/maven/conf/Settings. The XML file, add the warehouse < updatePolicy > always < / updatePolicy > to force update every time dependent libraries

<repositories>
        <repository>
                <id>central</id>
                <url>http://central</url>
                <releases>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                </releases>
                <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                </snapshots>
        </repository>
</repositories>

The second method was used, and the problem was solved