I have implemented the spring boot project with starter parent pom version 2.0.3. When I try to use
import org.apache.commons.lang.StringUtils
it throws error import cannot be resolved. Even though my m2 folder (C:\Users\.m2\repository\org\apache\commons) have lang package (commons-lang folder)installed. I also have commons-lang3 folder. If I change import to
import org.apache.commons.lang3.StringUtils
It works fine.
I have same version of starter pom in other spring boot project and there I am able to use commons.lang. Not able to identify the root cause.
As far as I can see the spring boot starter parent depends only on commons-lang3 and not on commons-lang (which is reasonable because commons-lang3 is a newer replacement for commons-lang).
It doesn't matter that your .m2 directory contains commons-lang (probably due to some other project depending on it): as long as your project hasn't declared a (direct or indirect) dependency on commons-lang, none of its classes will be on your classpath.