I am doing a Spring Boot exercise from Baeldung.com. The project has a test class that uses the method randomAlphabetic, which I have traced back to RandomStringUtils, which in turn belongs to Lang3 from Apache Commons. I can't seem to add the import of RandomStringUtils or even Lang3 itself to my project.
I have looked at the import on the GitHub repository for the project. The project is done as a Maven project, but I have done mine as a Gradle project, because Gradle is what I use at work (I don't know Maven). I have added the following to my build.gradle file:
plugins {
id 'org.apache.commons'
}
dependencies {
implementation 'org.apache.commons:commons-lang3:3.12.0'
}
I have attempted the following import statements:
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.*;
When I am writing my import statement and I put the period after commons, the autocomplete only comes up with two choices: logging and logging.impl . I do not even have an option to add lang3. I have also checked in the Spring Initializer to see if I could add lang3 there, but I cannot.
I have downloaded lang3 onto my computer. It contains 5 JAR files plus a lot of other material that I don't know how to use. I thought I could move those JAR files into my Project and External Dependencies 'folder,' but I can't find any way to do so. I'm using Spring Tools 4 Suite for Eclipse, btw.
Any help is appreciated.