开发者

Error reading settings.xml: Expected root element 'settings' but found 'servers' (position: START_TAG seen <servers>

I downloaded an existing Maven project into eclips开发者_开发问答e.

When I ran mvn install using the pom.xml file it failed showing the following error:

 mvn install
 Error reading settings.xml: Expected root element 'settings' but found 'servers' 
 (position: START_TAG seen  <servers>... @1:10)
 Line:   1
 Column: 10

I am using Maven 2.2.1 . and got settings.xml file under the M2 Home


I got this error in intellij (so the warning is not IDE specific) having imported a project using the POM at spring-data-neo4j-examples/cineasts/pom.xml on github

My settings.xml file contained the following

  <server>
        <id>LocalTomcat</id>
        <username>tomcat</username>
        <password>tomcat</password>
  </server>

Looking at http://maven.apache.org/settings.html I found the following settings template which contains the appropriate namespaces.

<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/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers/>
  <mirrors/>
  <proxies/>
  <profiles/>
  <activeProfiles/>
</settings>

I dropped in the original <server> settings into the element.

The warning no longer occurred upon running mvn compile

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜