From the course: Gradle for Java-Based Applications and Libraries

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Consuming an external dependency

Solution: Consuming an external dependency

From the course: Gradle for Java-Based Applications and Libraries

Start my 1-month free trial

Solution: Consuming an external dependency

(upbeat music) - [Instructor] Let's first identify what we have in this project here. You can see the build script doesn't actually look very complex. We apply the Java plugin and the application plugin. The version is set to 1.0.0. We're building with Java 11. And we can also execute the main class here directly from the build code. You can have a look at the source main Java directory within here. We have a main class. This main class instantiates the class string reverser. And down here, we actually invoke the method reverse with the help of the instance of string reverser and feed in two different strings here, abc and automobile. So let's jump over to the actual class here, and you can see the method that we implemented here, is fairly custom. So we first check if the given string that we want to reverse, is either null or blank string, then we handle it. Otherwise, we'll walk through each of the characters here…

Contents