Maven编译javax.ejb不存在 [英] Maven compiling javax.ejb does not exists

查看:497
本文介绍了Maven编译javax.ejb不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中创建了一个maven项目,当我尝试在项目目录mvn clean install中运行时,出现以下错误:

I created a maven project in eclipse and when I try to run in the project directory mvn clean install it gives this errors:

[INFO] Compiling 3 source files to C:\Users\Florin\Documents\Facultate\Master\TM
IS\Anul1\Sem2\ORM\Teme\Lab1_5\shop-interfaces\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Florin/Documents/Facultate/Master/TMIS/Anul1/Sem2/ORM/Teme/Lab
1_5/shop-interfaces/src/main/java/ro/unitbv/IShoppingCart.java:[5,17] package ja
vax.ejb does not exist
[ERROR] /C:/Users/Florin/Documents/Facultate/Master/TMIS/Anul1/Sem2/ORM/Teme/Lab
1_5/shop-interfaces/src/main/java/ro/unitbv/IShoppingCart.java:[7,2] cannot find
 symbol
  symbol: class Remote
[ERROR] /C:/Users/Florin/Documents/Facultate/Master/TMIS/Anul1/Sem2/ORM/Teme/Lab
1_5/shop-interfaces/src/main/java/ro/unitbv/ProductDao.java:[6,17] package javax
.ejb does not exist

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project shop-interfaces: Compilation failure: Com
pilation failure:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project shop-interfaces: Compilation failure: Com
pilation failure:
[ERROR] /C:/Users/Florin/Documents/Facultate/Master/TMIS/Anul1/Sem2/ORM/Teme/Lab
1_5/shop-interfaces/src/main/java/ro/unitbv/IShoppingCart.java:[5,17] package ja
vax.ejb does not exist
...

我检查了是否下载了包javax.ejb,它是否存在于.m2文件夹中.

I checked if the package javax.ejb is downloaded, and it exists in the .m2 folder.

我的pom文件是:

<?xml version="1.0"?>
<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>ro.unitbv</groupId>
  <artifactId>shop-interfaces</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <name>shop-interfaces</name>
  <dependencies>
    <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-api</artifactId>
      <version>7.0</version>
      <scope>povided</scope>
    </dependency>
  </dependencies>
</project>

推荐答案

根据您的实际需求,您必须定义javax.ejb的依赖关系,而该依赖关系在javaee-api中未定义.

Depending on what you really need you have to define the dependency for javax.ejb which is not defined in javaee-api.

您必须提供例如:

<dependency>
    <groupId>javax.ejb</groupId>
    <artifactId>javax.ejb-api</artifactId>
    <version>3.2</version>
    <scope>provided</scope>
</dependency>

这篇关于Maven编译javax.ejb不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆