I have downloaded some code from svn into my system. Now through maven I need to check if there are any updates on this code and if so then update it. I need not do a checkout of the whole code. So is it possible to do just update the existing source code of any project without maven creating a checkout directory?
I followed this post: Settings for Maven for conditional checkout or update from SVN?.
However I think only update won’t work if I don’t check out first.
There are two ways to do this. You can manually call
mvn scm:update, which will update the sources, if there are any changes, based on the<scm>settings that is specified for the project in the pom. Refer to this usage page and advanced scm commands documentation.The other way is to invoke this goal as part of the standard maven lifecycle. This is what is attempted in the referred question. There is no reason why update alone will not work. You can use the code snippet for the
update-project<execution>and modify it to your need.The latter may not be suited since build will not happen if you do off-line builds or if there is no scm connectivity for some reason. It is arguably better to do
mvn scm:update clean installor something similar.