简体   繁体   English

Maven编译javax.ejb不存在

[英]Maven compiling javax.ejb does not exists

I created a maven project in eclipse and when I try to run in the project directory mvn clean install it gives this errors: 我在eclipse中创建了一个maven项目,当我尝试在项目目录中运行mvn clean install时会出现以下错误:

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

I checked if the package javax.ejb is downloaded, and it exists in the .m2 folder. 我检查了是否下载了包javax.ejb,它是否存在于.m2文件夹中。

Edit: My pom file is: 编辑:我的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>

Depending on what you really need you have to define the dependency for javax.ejb which is not defined in javaee-api . 根据您真正需要的内容,您必须定义javax.ejb的依赖项,该依赖项未在javaee-api定义。

You have to give for example: 你必须举例如:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM