简体   繁体   English

HornetQ-pom.xml文件无效

[英]HornetQ - pom.xml file not valid

I try to get a HornetQ example running Tutorial 我尝试获得一个运行Tutorial的HornetQ示例

I copied the dependencies into my pom.xml file in eclipse but I get some errors, I do not understand. 我在eclipse中将依赖项复制到了pom.xml文件中,但是出现一些错误,我不明白。 I'm new to maven and already deleted my m2 repository and I always update with alt + f5 ("force update on snapshot/releases"). 我是maven新手,已经删除了我的m2存储库,并且我始终使用alt + f5 (“在快照/发行版上强制更新”)进行更新。

The pom.xml file: 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 message: 错误信息:

[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] 

I don't get why group and artifact id is missing since they are defined in the pom. 我不明白为什么缺少组和工件ID,因为它们是在pom中定义的。 As wells as I don't understand why modelversion is not valid. 至于我不明白为什么模型版本无效。

Since I am a beginner I hope to get a answer here. 由于我是初学者,所以我希望在这里得到答案。

Best regards 最好的祝福

The root cause for your error is a malformed XML due to 错误的根本原因是XML格式错误,原因是

Unrecognised tag: 'modelversion'

As per the XML scheme , the element needs to be named modelVersion (capital V). 根据XML方案 ,该元素需要命名为modelVersion (大写V)。

Also, the elements groupID and artifactID should be called groupId and artifactId respectively (lowercase d). 同样,元素groupIDartifactID应该分别称为groupIdartifactId (小写字母d)。

use bellow dependencies : 使用下面的依赖:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM