Cover by Hubert Klein Ikkink

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Working with Java multi-project builds

In a Java project, we usually have compile or runtime dependencies between projects. The output of one project is a compile dependency for another project, for example. This is very common in Java projects. Let's create a Java project with a common project that contains a Java class used by other projects. We will add a services project that references the class in the common project. Finally, we will add a web project with a Java servlet class that uses classes from the services project.

We have the following directory structure for our project:

root/ build.gradle settings.gradle common/ src/main/java/sample/gradle/util/ Logger.java services/sample src/main/java/sample/gradle/ api/ SampleService.java impl/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required