Test environment Maven 3.3.9
Presumably everyone in the Springboot application, will have the following code:
[HTML] view plain copy <parent> <groupId>org.springframework.boot</groupId> < ;artifactid>spring-boot-starter-parent</artifactid> <version>1.3.3.RELEASE</version> </ Parent> inherits a parent module and then introduces the corresponding dependency
If said, I do not want to inherit, or I want to inherit multiple, how to do.
We know that Maven inheritance, like Java inheritance, cannot achieve multiple inheritance, and if 10, 20 or more modules inherit from the same module, the dependencymanagement of this parent module will contain a lot of dependencies as we have done before. If you want to classify these dependencies for clearer management, it is impossible, and the import scope dependency can solve this problem. You can put dependencymanagement into a separate pom that is dedicated to managing dependencies, and then you can introduce dependencymanagement by importing a scope dependency in a module that needs to use dependencies. For example, you can write a pom that is used for dependency management:
[HTML] View Plain copy <project> <modelversion>4.0.0 </modelVersion> <groupId>com.test.sample</groupId> <artifactId>base-parent1</artifactId> <packaging>pom</packaging> <version>1.0.0-snapshot </version> <dependencyManagement> <dependencies> <dependency> <groupId>junit</groupId> <artifactid>junit</ Artifactid> <version>4.8.2</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactid>