Maven构建错误 - 无法确定主机信息

时间:2015-02-04 10:44:52

标签: maven maven-3

我是maven的新手。 当我尝试运行" mvn compile"我收到以下错误

Failed to execute goal 
de.smartics.maven.plugin:buildmetadata-maven-plugin:1.4.0:provide-buildmetadata (default)
on project xxxxx: 
Cannot determine host information. SJP2S5-113053048D: SJP2S5-113053048D:
nodename nor servname provided, or not known -> [Help 1]

[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

这是我的settings.xml

<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0                       http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://xxxx-xxxx.xxxxx.com/xxxx/content/xxxx/public</url>
    </mirror>
  </mirrors>

 <profiles>
    <profile>
      <id>nexus</id>
      <properties>
         <repo-releases-url>http://xxx-xxxxxx.xxxx.com/xxxxx/content/repositories/releases/</repo-releases-url>
         <repo-snapshots-url>http://xxx-xxxxx.xxxx.com/xxxxx/content/repositories/snapshots/</repo-snapshots-url>
      </properties>
      <!-- Enable snapshots for the built in central repo to direct -->
      <!-- all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <!-- make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>

  <pluginGroups>
    <pluginGroup>com.webobjects.maven.plugins</pluginGroup>
    <pluginGroup>org.mortbay.jetty</pluginGroup>
  </pluginGroups>

  <servers>
    <server>
      <id>snapshots</id>
      <username>xxxx_engineer</username>
      <password>xxxxx</password>
    </server>
    <server>
      <id>thirdparty</id>
      <username>xxxxx</username>
      <password>xxxx</password>
    </server>
  </servers>

</settings>

我已尝试mvn cleanmvn compilemvn clean成功,但mvn compile会产生上述错误,我不明白。

我检查了错误中提到的链接,并在settings.xml中讨论了代理设置。

我正在使用 Maven 3.0.4 Jdk 1.7 MAC OS X

以下是上述命令mvn --version

的结果
$ mvn --version

Apache Maven 3.0.4 (r1232337; 2012-01-17 14:14:56+0530)
Maven home: /Users/raghuramankumarasamy/Documents/raghu/maven/apache-maven-3.0.4
Java version: 1.7.0_75, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10", arch: "x86_64", family: "mac"

我正在使用mac os X

以下命令hostname,给出以下结果....

SJP2S5-113053048D:xxxxx raghuramankumarasamy $ hostname

SJP2S5-113053048D


根据请求添加了部分pom.xml

<pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>de.smartics.maven.plugin</groupId>
                                        <artifactId>buildmetadata-maven-plugin</artifactId>
                                        <versionRange>[0.0.0,)</versionRange>
                                        <goals>
                                            <goal>provide-buildmetadata</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

0 个答案:

没有答案