If you’re here, then you probably were met with a Java stack trace that has lines similar to this in it:
package org.apache.commons.lang does not exist...static import only from classes and interfaces
I saw this in a few Spring Boot applications with Maven, and the good news is that the fix should be easy.
In your source code, do a global search for the following
import static org.apache.commons.lang
Then, replace all instances of that with the following:
import static org.apache.commons.lang3
Let’s say a program has the following Commons Lang
import static org.apache.commons.lang.StringUtils.isBlank;
import static org.apache.commons.lang.StringUtils.isNotBlank;
Simply put a
lang. Your final
import statements will then look like this:
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
Your app should now build.
Basically, Commons Lang
3.x brought in this new package naming with the
lang3. More details on that as well as what else changed from
3.x are here.