The Classifier

In the previous chapters, we dealt with the main ways to identify a dependency: groupId, artifactId, version, and scope. Let's see the final tags that are available.

The classifier tag is used to distinguish between different artifacts that were built from the same POM and source code. The classifier can be any string.

Common use cases when classifiers are specified are as follows:

  • Artifacts generated owing to an environment (development, integration, QA, production, and so on)
  • Artifacts related to a system, calling native functions, for example, one JAR for Windows, and another of Linux
  • Artifacts related to different JDK and JRE levels, for example, one JAR for JDK-1.4 (that is, without annotations, generics, and so on), another for ...

Get Apache Maven Dependency Management now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.