Here is a description of the differences between dependencymanagement and dependencies declared in the root node of the parent project Dependencymanagement
Maven uses the Dependencymanagement element to provide a way to manage dependent version numbers. The dependencymanagement element is typically seen in the parent pom at the top level of an organization or project. Using the Dependencymanagement element in Pom.xml can make
All references a dependency in a subproject without explicitly listing the version number. Maven walks up the parent-child hierarchy until a project with the dependencymanagement element is found, and then it uses the version number specified in the Dependencymanagement element.
For example in parent project: XML code <dependencyManagement> <dependencies> <dependency> <groupid>mysql</group id> <artifactId>mysql-connector-java</artifactId> <version>5.1.2</version> </ Dependency> <dependencies> </dependencyManagement>
You can then add mysql-connector to a subproject without specifying a version number, for example:
XML code <dependencies> <dependency> <groupId>mysql</groupId> <artifactid>mysql-connect Or-java</artifactid> </dependency> </dependencies>
The advantage of this is that if you have multiple sub-projects that reference the same dependency, you can avoid declaring a version number in each subproject, so that when you want to upgrade or switch to another version, you only need to update it in the top-level parent container, without the modification of a single subproject In addition, if a subproject requires a different version, you only need to declare version.
Dependencymanagement only declares dependencies and does not implement ingestion, so the subproject needs to explicitly declare the dependencies that need to be used. Dependencies
As opposed to dependencymanagement, all claims in dependencies are automatically introduced and inherited by all sub-projects by default.
classifier
If you want to publish the same code, but for technical reasons you need to generate two separate artifacts, you will have to use a classifier (classifier). For example, if you want to build two separate artifacts into jars, one using the Java 1.4 compiler and the other using the Java 6 compiler, you can use the classifier
To generate two separate jar artifacts that have the same groupId:artifactId:version combination. If your project uses a local extension class library, you can use the classifier to generate a widget for each target platform. Classifiers are commonly used in source code, JAVADOC, or binary collections of packaged components.