Avoid calling the maven-dependency-plugin for all builds

Only trigger the maven-dependency-plugin when the there's a full build or when the pom.xml is part of the incremental changes
Also, replace calls to deprecated methods and added tests to check that the maven-dependency-plugin is called or not (using the junit:junit:4.10
artifact instead of the plugin itself, which doesn't work unless it has been installed in the local repo at least once before)