java - 执行 Maven 时出错 - 不可解析的设置 settings.xml

标签 java eclipse maven cucumber

我是 Maven 新手。我已将 Cucumber 项目转换为 Maven,当我尝试运行 Maven Clean 或 Maven Build 时,出现执行错误。

[ERROR] Error executing Maven.
[ERROR] 1 problem was encountered while building the effective settings
[FATAL] Non-parseable settings C:\Users\qz\.m2\settings.xml: end tag name </settings> must match start tag name <activeProfiles> from line 10 (position: TEXT seen ...</pluginManagement>   \r\n</build>\r\n</settings>... @21:12)  @ C:\Users\qz\.m2\settings.xml, line 21, column 12

Maven Installation and Configuration 的快照 我的 settings.xml 文件也有一些问题,在 Eclipse > Windows > Preferences > Maven > User Settings 下,我可以看到错误“无法读取 settings.xml”

我尝试删除我的存储库文件夹并重建它,但这没有效果。这可能与我的 Eclipse-Maven 集成有关。

编辑1:添加settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

 <localRepository>Users/qz/.m2/repository</localRepository>
 <interactiveMode>true</interactiveMode>
 <offline>false</offline>
  <profiles><profiles/>
  <activeProfiles><activeProfiles/>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.6</version>
        </plugin>           
      </plugins>
    </pluginManagement>   
</build>
</settings>

Edit-2:更正了 .xml 并更新了错误消息

最佳答案

关闭 xml 标签应为 </tagName>

  <localRepository>Users/qz/.m2/repository 
 </localRepository>
 <interactiveMode>true</interactiveMode>

单个标签中可以有空标签,如 <tagName/>或者您可以将其删除

   <activeProfiles/>

关于java - 执行 Maven 时出错 - 不可解析的设置 settings.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53562194/

相关文章:

Javamail java.security.cert.CertPathValidatorException 从 pop3 接收邮件时

java - maven 找不到生成的源(mvn clean install)

eclipse - CDT 包括自定义工具链的发现

java - 使用 AbstractAnnotationConfigDispatcherServletInitializer 处理两个调度程序 Servlet

java - 运行 Maven 时为 "Invalid maximum heap size"

java - 对象如何使用方法在java中相互交互?

java - 用Java解析HTML

java - 从 Windows 任务计划程序客户端在共享驱动器上运行 Java 应用程序

javascript - 使用 JavaScript 修改 BIRT 中的查询输出

java - 如何根据 Maven 阶段(安装或测试)在 DAO 类中使用不同的持久性单元?