当运行“MVN测试”在命令提示符下,遇到错误

问题描述 投票:1回答:2

当运行“MVN测试”在命令提示符下,遇到错误。我需要运行“MVN测试”与Maven和Java测试报告JUnit的插件。

命令提示符:

[ERROR]错误执行的Maven。 [错误],同时建立有效的设置[FATAL]非解析的设置下遇到问题1:\ Program Files文件\ Apache的行家-3.6.0 \ BIN .. \的conf \ settings.xml的:结束标签名称必须匹配开始标记来自管线102命名\ N - > \ n ... @ 254:12> @ C:\ Program Files文件\ Apache的行家-3.6.0 \ BIN .. \ CONF \ settings.xml中,线254,第12栏

的settings.xml

46<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
47          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
48          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
49  <!-- localRepository
50   | The path to the local repository maven will use to store artifacts.
51   |
52   | Default: ${user.home}/.m2/repository
53  -->
54  <localRepository>C:\Users\hiddenuser\.m2\repository</localRepository>
55  
56  <!-- interactiveMode
57   | This will determine whether maven prompts you when it needs input. If set to false,
58   | maven will use a sensible default value, perhaps based on some other setting, for
59   | the parameter in question.
60   |
61   | Default: true
62  <interactiveMode>true</interactiveMode>
63  -->
64
65  <!-- offline
66   | Determines whether maven should attempt to connect to the network when executing a build.
67   | This will have an effect on artifact downloads, artifact deployment, and others.
68   |
69   | Default: false
70  <offline>false</offline>
71  -->
72
73  <!-- pluginGroups
74   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
75   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
76   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
77   |-->
78  <pluginGroups>
79    <!-- pluginGroup
80   | Specifies a further group identifier to use for plugin lookup.
81    <pluginGroup>com.your.plugins</pluginGroup>
82    -->
83  </pluginGroups>
84
85  <proxies>
86    <proxy>
87      <id>optional</id>
88      <active>true</active>
89      <protocol>http</protocol>
90      <!-- <username></username>
91      <password></password> -->
92      <host>hidden only</host>
93      <port>hidden only</port>
94      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
95    </proxy>
96  <proxies>
97  
98  <!-- servers
99   | This is a list of authentication profiles, keyed by the server-id used within the system.
100  | Authentication profiles can be used whenever maven must make a connection to a remote server.
101  |-->
102  <servers>
eclipse maven selenium automation command-prompt
2个回答
1
投票

在行号:92你刚才评论<servers>,并在行中没有102它的收盘<servers>开幕,错误本身说的是,你通过不必要的评论标签,请删除注释符号..

end tag name must match start tag name from line 102

因此,更新文件,然后再执行它,让我们知道,这个解决方案是帮助你或不

参考访问官方网站获取更多信息

https://maven.apache.org/settings.html

更多参考

Error "The goal you specified requires a project to execute but there is no POM in this directory" after executing maven command

maven generating pom file


0
投票

非解析的设置

C:\ Program Files文件\ Apache的行家-3.6.0 \ BIN .. \的conf \ settings.xml的:结束标签名称必须与从线102开始的标记名称

你的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 | The path to the local repository maven will use to 
        store artifacts. | | Default: ${user.home}/.m2/repository -->
    <localRepository>C:\Users\hiddenuser\.m2\repository</localRepository>

    <!-- interactiveMode | This will determine whether maven prompts you when 
        it needs input. If set to false, | maven will use a sensible default value, 
        perhaps based on some other setting, for | the parameter in question. | | 
        Default: true <interactiveMode>true</interactiveMode> -->

    <!-- offline | Determines whether maven should attempt to connect to the 
        network when executing a build. | This will have an effect on artifact downloads, 
        artifact deployment, and others. | | Default: false <offline>false</offline> -->

    <!-- pluginGroups | This is a list of additional group identifiers that 
        will be searched when resolving plugins by their prefix, i.e. | when invoking 
        a command line like "mvn prefix:goal". Maven will automatically add the group 
        identifiers | "org.apache.maven.plugins" and "org.codehaus.mojo" if these 
        are not already contained in the list. | -->
    <pluginGroups>
        <!-- pluginGroup | Specifies a further group identifier to use for plugin 
            lookup. <pluginGroup>com.your.plugins</pluginGroup> -->
    </pluginGroups>

    <proxies>
        <proxy>
            <id>optional</id>
            <active>true</active>
            <protocol>http</protocol>
            <!-- <username></username> <password></password> -->
            <host>hidden only</host>
            <port>hidden only</port>
            <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
        </proxy>
    </proxies>

    <!-- servers | This is a list of authentication profiles, keyed by the server-id 
        used within the system. | Authentication profiles can be used whenever maven 
        must make a connection to a remote server. | -->
    <servers>
    </servers>
</settings>

您还没有指定结尾匹配/服务器和/设置在settings.xml文件,这就是为什么你越来越“非解析的设置”的错误。

© www.soinside.com 2019 - 2024. All rights reserved.