2011-08-22 91 views
1

我正在通過Hibernate教程http://docs.jboss.org/hibernate/stable/core/reference/en-US/html_single/。我創建了一個新項目,並使用Ch中示例中給出的pom.xml。 1缺失神器org.jboss:jandex:jar:1.0.0.Beta7 - Hibernate教程

<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>org.hibernate.tutorials</groupId> 
<artifactId>hibernate-tutorial</artifactId> 
<version>1.0.0-SNAPSHOT</version> 
<name>First Hibernate Tutorial</name> 

<build> 
    <!-- we dont want the version to be part of the generated war file name --> 
    <finalName>${artifactId}</finalName> 
</build> 

<dependencies> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>4.0.0.Beta5</version> 
    </dependency> 


    <!-- Because this is a web app, we also have a dependency on the servlet api. --> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>servlet-api</artifactId> 
     <version>3.0-alpha-1</version> 
    </dependency> 


    <!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend --> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
     <version>1.6.1</version> 
    </dependency> 


    <!-- Hibernate gives you a choice of bytecode providers between cglib and javassist --> 
    <dependency> 
     <groupId>javassist</groupId> 
     <artifactId>javassist</artifactId> 
     <version>3.12.1.GA</version> 
    </dependency> 

</dependencies> 

我使用JBoss 7 - 我得到的錯誤缺少神器org.jboss:jandex:罐子:1.0.0.Beta7。我試圖包含jandex作爲依賴,但我仍然得到這個錯誤。我確認jandex存在於/ modules/org/jboss/jandex中。我該如何解決這個錯誤?

回答

10

以下內容添加到您的pom.xml文件:

<repositories> 
    <!-- For hibernate support --> 
    <repository> 
    <id>jboss</id> 
    <url>https://repository.jboss.org/nexus/content/groups/public/</url> 
    </repository> 
</repositories> 
+0

它的工作對我來說,日Thnx很多 –