Maven update with new file with the same version
I am using Maven and have a problem - if my colleague 开发者_JAVA技巧update jar file - Maven doesn't update it. So I have go to .m2/repository and manually delete it. After this Maven update dependance jar correct. But may be exists another way to adjust, without each time delete manually? Thanks.
First, you should make sure that your colleague's artifact is released with a SNAPSHOT version number as long as it it is not yet stable (see http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-syntax.html#pom-relationships-sect-snapshot-versions). This will cause Maven to check for updates regularily.
To specify how often the check occurs, you can modify the updatePolicy
of the repository to which your colleague deploys (see http://maven.apache.org/settings.html#Repositories). You can set it to always
to make Maven pull snapshot updates as soon as your colleague deploys them.
You can also add -U to the mvn command to force maven to check the repository for updates (mvn clean install -U) but like dosendoc said first make sure you're working off SNAPSHOT versions.
精彩评论