pom.xml 出现的问题- wfwkiss - JavaEye技术网站
DOS下出现错误:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.hibernate.tutorials:hibernate-tutorials
POM Location: C:\hibernate-tutorials\pom.xml
Validation Messages:

    [0]  'dependencies.dependency.version' is missing for org.slf4j:slf4j-simple:jar
    [1]  'dependencies.dependency.version' is missing for javassist:javassist:jar


Reason: Failed to validate POM for project org.hibernate.tutorials:hibernate-tutorials at C:\hiberna
te-tutorials\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>org.hibernate.tutorials</groupId>
<artifactId>hibernate-tutorials</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>First Hibernate Tutorials</name>
<url>http://maven.apache.org</url>

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

<dependencies>

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

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2</version>
<type>jar</type>
<scope>runtime</scope>
</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>5</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.3</version>
</dependency>

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

</dependencies>

</project>
郑重声明:资讯 【pom.xml 出现的问题- wfwkiss - JavaEye技术网站】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——