After running maven commands, the jboss
artifact sits cached in my local repo /.m2
. However, it's the wrong copy, and we have updated our artifactory on the local server. How do I remove this cached copy? (other than manually deleting the jboss
folder from the /.m2/repository/org
folder). Is there a maven command to do so? Also, I was wondering how exactly the local repository is structured, is it according to groupId, artifactId, version (GAV)
in any way?
问题:
回答1:
Snapshot artifacts can be force-updated by using -U
option with mvn
when building a project with the dependency. Maven will take the newest snapshot available of the specified version. You have to deploy the fixed snapshot artifact to the repository before. The newest snapshot is determined by the timestamp attached to the file name of the jar.
However, release versions are not updated. Once a release artifact has been downloaded and verified, you must remove it manually if you replaced it on a remote repository. Generally, you should never replace release version artifacts. Rather you should always release a new version (and possibly delete the erroneous version from the repository) and change the pom.xml
files of projects which use this artifact.
For the structure of the local/remote repository, see links below.
References:
- Force maven update
- maven artifact repository directory structure specs
Maven repository layout