繁体   English   中英

如何在 spring-boot 项目中向 pom.xml 添加非 spring-boot 依赖

[英]How to add a non-spring-boot dependency to the pom.xml in a spring-boot project

我有一个Spring Boot项目,我想在那里使用对ModelMaker的依赖:

    <dependency>
        <groupId>org.modelmapper</groupId>
        <artifactId>modelmapper</artifactId>
        <version>2.3.6</version>
    </dependency>

如果我添加它,我会收到错误消息:

Save could not be completed. Try File > Save As... if the problem persists.

Reason:
Could not write file pom.xml

details:
Could not write file: D:\...\pom.xml.
D:\...\pom.xml (The requested operation cannot be performed on a file with a user-mapped section open)

ModelMapper不属于标准的Spring Boot器,因此我无法通过 Spring>Edit Starters 将其添加到pom.xml

如何添加非启动依赖项?

今天我发现了同样的问题。

如果您使用的是 IntelliJ,只需右键单击 pom.xml,然后单击 Maven,然后单击重新导入。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM