java - 未找到依赖项'javax:javaee-api:6.0'
问题描述
我是一名计算机科学专业的学生,目前我正在迈出使用 JEE 的第一步。为了重试我的学习材料的示例,我尝试使用 IntelliJ 社区构建一个 Web 应用程序。由于社区版本没有正式的可能性,因此我尝试按照本教程使用 maven:https ://www.shortn0tes.com/2017/01/tutorial-intellij-idea-community.html
现在我得到一个关于 pom.xml 中 javax 依赖注入的错误: Dependency 'javax:javaee-api:6.0' not found
我需要在 IntelliJ IDE 中添加/配置什么吗?我知道本教程可能不再是超现代的了,但我只想以我的大学材料为例。
非常感谢!
这是我的 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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.example</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>test Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>test</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>8888</port>
<path>/</path>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
解决方案
推荐阅读
- css - How to use parent div font color instead of child
- javascript - how to quick up the process of displaying images in React coming from backend (Django Rest)
- python - Difference in run time complexity of two seemingly similar solutions
- javascript - node.js中的through2和native Transform流有什么区别?
- file-upload - 如何使用按钮标签以无头模式上传文件
- unit-testing - 如何对 Umbraco Api 控制器进行单元测试 - System.ArgumentNullException:'值不能为空。参数名称:umbracoContext'
- android - How to update existing line layer in MapBox
- replace - 如何在vscode中用字符串+变量替换所有元素?
- flutter - Flutter :- Create circular border around icons
- django-rest-framework - Django 响应发送文件以及一些文本数据