Pom.xml:连接timedout和modelversion缺失错误

时间:2015-04-30 15:29:20

标签: java xml maven pom.xml

我在eclipse上为pom.xml文件收到以下错误。

Multiple annotations found at this line:
    - connect timed out
    - Failure to transfer org.jibx:jibx-maven-plugin:pom:1.2.4 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be 
     reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.jibx:jibx-maven-plugin:pom:1.2.4 from/to central 
     (http://repo.maven.apache.org/maven2): connect timed out
    - Project build error: 'modelVersion' is missing.

pom.xml如下:

<?xml version="1.0" encoding="UTF-8"?>
<project 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.koushik.javabrains</groupId>
      <artifactId>testagain</artifactId> 
      <version>1.0-SNAPSHOT</version>
      <packaging>jar</packaging>

      <name>JarName</name>
      <url>http://maven.apache.org</url>

      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>

      <build>
        <plugins>
          <plugin>
            <groupId>org.jibx</groupId>
            <artifactId>jibx-maven-plugin</artifactId>
            <version>1.2.4</version>
            <executions>
              <execution>
                <goals>
                  <goal>bind</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </project>

任何帮助都会很棒。 提前谢谢。

1 个答案:

答案 0 :(得分:2)

jibx-maven-plugin版本1.2.4看起来有问题 它依赖于:

org.jibx.config:jibx-parent:pom:3-SNAPSHOT

在Maven Central中找不到。我用你的pom.xml创建了一个简单的项目 - 当我尝试从命令行用maven构建它时 - 我得到了这个:

  

[错误]插件org.jibx:jibx-maven-plugin:1.2.4或其中一个依赖项无法解析:无法读取org.jibx的工件描述符:jibx-maven-plugin:jar:1.2。 4:找不到工件org.jibx.config:jibx-parent:pom:3-SNAPSHOT - &gt; [帮助1]

但是,在将pom.xml升级为使用版本1.2.6之后,问题就会消失,Eclipse也会停止抱怨该插件。

*它仍然抱怨插件执行不在生命周期配置中,但是there are solutions to this as well