尝试执行maven构建时出现以下错误:
[错误]无法在项目hellohibernate上执行目标:无法解决项目的依赖关系org.nsingh.hibernate:hellohibernate:war:1.0:找不到工件org.hibernate:hibernate:jar:3.5.4-Final in中心(http://repo.maven.apache.org/maven2) - > [帮助1] [错误]
对于以下pom:
<project>
<modelVersion>4.0.0</modelVersion>
<version>1.0</version>
<groupId>org.nsingh.hibernate</groupId>
<artifactId>hellohibernate</artifactId>
<packaging>war</packaging>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>WebContect</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.0.CR1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.0.0.CR1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.5.4-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>3.3.2.Beta1</version>
</dependency>
</dependencies>
</project>
如何解决这个问题?
答案 0 :(得分:2)
让我回答一下:
添加
<type>pom</type>
依赖。