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