HornetQ - pom.xml 文件无效

HornetQ - pom.xml file not valid

我尝试获取一个 HornetQ 示例 运行 Tutorial

我在 eclipse 中将依赖项复制到我的 pom.xml 文件中,但出现一些错误,我不明白。我是 Maven 的新手,已经删除了我的 m2 存储库,我总是使用 alt+f5 ("force update on snapshot/releases").

pom.xml 文件:

<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/xsd/maven-4.0.0.xsd">
  <modelversion>4.0.0</modelversion>
  <groupID>mannheim</groupID>
  <artifactID>hornetq</artifactID>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>HornetQHelloWorld</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupID>junit</groupID>
      <artifactID>junit</artifactID>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  <dependency>
     <groupID>org.hornetq</groupID>
     <artifactID>hornetq-core</artifactID>
     <version>2.0.0.GA</version>
     <scope>compile</scope>
  </dependency>
  <dependency>
     <groupID>org.hornetq</groupID>
     <artifactID>hornetq-jms</artifactID>
     <version>2.0.0.GA</version>
     <scope>compile</scope>
  </dependency>
  <dependency>
     <groupID>org.hornetq</groupID>
     <artifactID>hornetq-logging</artifactID>
     <version>2.0.0.GA</version>
     <scope>compile</scope>
  </dependency>
  <dependency>
     <groupID>org.hornetq</groupID>
     <artifactID>hornetq-transports</artifactID>
     <version>2.0.0.GA</version>
     <scope>compile</scope>
  </dependency>
  <dependency>
     <groupID>org.jboss.netty</groupID>
     <artifactID>netty</artifactID>
     <version>3.1.0.GA</version>
  </dependency>
  <dependency>
     <groupID>org.jboss.javaee</groupID>
     <artifactID>jboss-jms-api</artifactID>
     <version>1.1.0.GA</version>
     <scope>compile</scope>
  </dependency>
  </dependencies>

  </project>

错误信息:

[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project [unknown-group-id]:[unknown-artifact-id]:1.0-SNAPSHOT (C:\Users\Julian\workspace\hornetq\pom.xml) has 3 errors
[ERROR]     Malformed POM C:\Users\Julian\workspace\hornetq\pom.xml: Unrecognised tag: 'modelversion' (position: START_TAG seen ....0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r\n  <modelversion>... @3:17)  @ C:\Users\Julian\workspace\hornetq\pom.xml, line 3, column 17 -> [Help 2]
[ERROR]     'groupId' is missing. @ line 2, column 102
[ERROR]     'artifactId' is missing. @ line 2, column 102
[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] 

我不明白为什么缺少组和工件 ID,因为它们是在 pom.xml 中定义的。以及我不明白为什么模型版本无效。

由于我是初学者,希望能在这里得到解答。

此致

您的错误的根本原因是格式错误 XML 由于

Unrecognised tag: 'modelversion'

根据 XML scheme,元素需要命名为 modelVersion(大写 V)。

此外,元素 groupIDartifactID 应分别称为 groupIdartifactId(小写 d)。

使用以下依赖项:

<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-core</artifactId>
<version>2.2.23.Final-redhat-1</version>
</dependency>

<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jms-client</artifactId>
<version>2.4.7.Final</version>
</dependency>

<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jms</artifactId>
<version>2.2.19.Final</version>
</dependency>

<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-transports</artifactId>
<version>2.1.0.r9031</version>
</dependency>

<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-logging</artifactId>
<version>2.2.21.Final</version>
</dependency>