I try to not use SNAPSHOT dependencies in Maven but sometimes, as code is in process, I need to temporarily reference a SNAPSHOT dependency. If that SNAPSHOT dependency is in my local Maven repository, my local build will work. But, when the project gets built in another environment (like Travis-CI’s), the build fails. To work around this, the project needs to be aware of how to resolve those SNAPSHOT dependencies.
To accomplish this, add
pluginRepositories if the SNAPSHOT is also a plugin) to the project’s pom.xml file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
With these two elements added, the Travis build will be able to resolve the SNAPSHOT dependencies. The elements can be removed again once the SNAPSHOT dependencies are replaced with stable versions.