"Spring Cloud" Spring Cloud sub-module Pom file added dependency, unknown problem "maven" appears

Source: Internet
Author: User

The Spring cloud project is typically a parent project with more than one child service, which is the Submodule module.

Such as:

problem Description: A common jar package is referenced in the parent project, for example, the spring boot dependency is introduced, then the introduction of the jar package in the subproject does not specify version, so the downloaded jar package is unknown

Analyze the problem:

Because the jars used in the subproject are all spring cloud-related jar packages, you must specify Spring-cloud unified management in the parent project's Pom.xml file in order for the Child project to reference the spring Cloud-related JAR packages do not specify the jar package version, and there is no unknown problem

Solve the problem:

Add code to the parent project's Pom.xml file

<dependencyManagement>        <dependencies>            <dependency>                <groupId> Org.springframework.cloud</groupid>                <artifactId>spring-cloud-dependencies</artifactId>                <version>Dalston.SR1</version>                <type>pom</type>                <scope>import</ scope>            </dependency>        </dependencies>    </dependencyManagement>
View Code

Such as:

"Spring Cloud" Spring Cloud sub-module Pom file added dependency, unknown problem "maven" appears

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.