When you encounter a compilation error in a newly downloaded Maven project you need to check what's the origin of a given problem. I would classify Maven project compilation errors into two main categories:
1. Dependency used from within the project code introduces compilation error. It can occur in the following cases:
a). the dependency was deleted from remote Maven repository:
- particular version was removed because it had some critical bugs (e.g. security related) and you should increase the dependency version number and then of course execute regression testing to check if nothing was broken by that,
- the dependency was totally removed, moved to a different location or renamed for some reason.
b). you are unable to reach Maven repository containing the dependency:
- Maven repository in which the dependency exists was not defined in pom.xml file or it is defined within a non-active Maven profile. It may be described in README.txt or Wiki of the project to add particular repositories to your settings.xml file. Personally, I do not like any README.txt files. I think that the project itself should be self-sufficient meaning in that case that the repositories should be defined in a root pom.xml,
- you do not have an access to a given Maven repository - maybe some proxy or firewall rule must be added or you need to create a tunnel or connect to a certain VPN.
2. There is a compilation error within the project - meaning that someone committed/pushed some code which does not compile. You should check annotations in version control system and ask that person about explanation. This situation may occur rather rarely because every decent project has continuous integration in place and the unlucky committer should've been automatically notified about a mistake s/he had committed.
That's all folks!
I'm glad I could inspire you! :)
ReplyDeletePP