Your build output should not have any warnings

Posted by Joep Weijers on July 29, 2026

How much output does your Maven build generate? Lots of output, unnecessary warnings and errors in your build may mask newly introduced or real potential problems. At TOPdesk we therefore have a Minimum Quality Requirement to keep build warnings to a minimum, such that we can easily identify real issues. Here are some common warnings that may pop up and how to solve them.

Maven misconfiguration warnings

Maven validates the project setup at the start of every Maven command. Any issues found “threaten the stability of your build” and should be resolved. For example, if you have a dependency defined twice with different versions, Maven does not know which version you actually want. So it shows the following error:

The several lines starting with [WARNING] capture the attention and clearly describe the issue. So in this case we need to remove the duplicate dependency declaration and the warnings disappear.

Should the issue not be clear, then the internet might offer help. You are probably not the first with the issue so an internet search might offer a solution. And if you did find a unique problem, then a question on the Maven StackOverflow might see an answer from one of the Maven maintainers.

Deprecation warnings

The Java language and your dependencies are evolving. Their maintainers may come up with new APIs to replace old ones. To notify consumers of those old APIs that the new APIs should be used, they can be marked @Deprecated. Your Integrated Development Environment can show Deprecated API usage. But your Maven build can (and should) as well by configuring the maven-compiler-plugin to show warnings and deprecations:

Now your build output will also list all unhandled Deprecation warnings, so you can go ahead and solve them for a future proof build.

Most Deprecation warnings have a clear description of what to use instead. But there are always a few that may lead to a search through the libraries’ source code on GitHub to figure out what the correct replacement is. If you do manage to figure that out, consider creating a pull request on the project to clarify the documentation, so you can help the person who inevitably runs into the same issue after you.

Relocation warnings

When a Maven artifact changes its groupId or artifactId, all consumers need to update to the new Maven coordinates. Failing to do so, will mean you (or your renovatebot) won’t get the latest features and bug fixes, because you are still looking at the old artifact. Provided the owners of the artifact have set it up correctly, Maven will warn you about relocated artifacts:

The solution is to use the updated artifact coordinates. In this example we need to change the groupId from ant to org.apache.ant.

JUnit Warnings

If you are using JUnit as your test framework, one particular warning line may show up in your Maven build:

JUnit considers a @Disabled test a warning. So when you see one, ask yourself: why is that test disabled?

  • Is it a failing test that still has to be fixed? Then fix it!
  • Is it a test that should not run as part of your build, but can be activated manually? Use JUnit tags combined with Maven profiles for the surefire plugin to properly set up your different builds.
  • Is it kept for documentation or sentimental reasons? Is it really the best place for that documentation? If you remove both the @Disabled and the @Test annotation, then you still have the code there, that is not executed as test, but without the build warning.

How we notify our developers of warnings in their build outputs

If you have no warnings in your build output, then the introduction of a new warning will stand out. If you already have warnings, then an extra warning may go unnoticed. Or even actively ignored following the broken window theory. Therefore we require our developers to not have any warnings in their build.

In our continuous integration pipelines, we take the output of the Maven build and grep for [WARNING]s or [ERROR]s in the output. If those are present we fail the pipeline, so developers must fix any issues they introduced. This is an effective way to make sure we remain at zero warnings in our build output!

Joep Weijers

Joep is a Developer Experience Engineer at TOPdesk with a keen interest in delivering quality software continuously. He loves playing around with GitLab CI pipelines, Selenium, Docker, Kubernetes and keeps in touch with his inner developer by educating his colleagues on testable Java code.

More Posts - Website