マルチモジュールのMavenプロジェクトでエラーが発生します。オプションとしてEclipserunを介して「maveninstall」を実行しようとしています。
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mysite-entities 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ mysite-entities ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/thomas/spring/mysite-parent/mysite-entities/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mysite-entities ---
[INFO] Compiling 11 source files to /home/thomas/spring/mysite-parent/mysite-entities/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/thomas/spring/mysite-parent/mysite-entities/src/main/java/com/mysite/entities/Mcc.java:[5,24] package javax.persistence does not exist
[ERROR] /home/thomas/spring/mysite-parent/mysite-entities/src/main/java/com/mysite/entities/Mcc.java:[6,24] package javax.persistence does not exist
[ERROR] /home/thomas/spring/mysite-parent/mysite-entities/src/main/java/com/mysite/entities/Mcc.java:[8,1] cannot find symbol
symbol: class Entity
@Entity
Mcc.java:
package com.mysite.entities;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Mcc implements Serializable
{
/**
*
*/
private static final long serialVersionUID = 4146710247449711520L;
@Id
private Long id;
private String name;
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
私のpom.xmlには次のものが含まれています。
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
プルされたMavenの依存関係を確認しました。これらの依存関係には、必要なすべてのクラスが含まれるhibernate-jpa-2.0-api-1.0.1.Final.jarが含まれています。
なぜこのMavenエラーが発生するのですか?