maven - pom.xml 包含 scalatest intellij 未编译
问题描述
我已经开始了一个相对较新的项目,并且正在尝试按照这些说明(maven)将 scalatest 包含在我的 intellij 项目中:https ://www.scalatest.org/install 。
我已经成功完成了这些步骤,将 maven 包含在我的项目中:https ://www.jetbrains.com/help/idea/convert-a-regular-project-into-a-maven-project.html#add_maven_support
现在我有这个:
<?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>independentstudy.project</groupId>
<artifactId>Connect4</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>
<dependency>
<groupId>org.scalactic</groupId>
<artifactId>scalactic_2.13</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<version>3.2.5</version>
<scope>test</scope>
</dependency>
<repositories>
<repository>
<id>artima</id>
<name>Artima Maven Repository</name>
<url>http://repo.artima.com/releases</url>
</repository>
</repositories>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<compilerPlugins>
<compilerPlugin>
<groupId>com.artima.supersafe</groupId>
<artifactId>supersafe_2.13.5</artifactId>
<version>1.1.12</version>
</compilerPlugin>
</compilerPlugins>
</configuration>
<executions>
...
</executions>
</plugin>s
</project>
这是对第一组的愤怒<dependancy>
我错过了什么?
解决方案
<dependency>
标签必须包含在<dependencies>
标签中:
<dependencies>
<dependency>
<groupId>org.scalactic</groupId>
<artifactId>scalactic_2.13</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<version>3.2.5</version>
<scope>test</scope>
</dependency>
</dependencies>
有关 pom.xml 语法参考,请参阅 Maven 文档:依赖管理。
推荐阅读
- java - 使用 Java 从 FTP 检索文件没有类错误
- c# - 有没有办法从网页获取 JSON 数据并将数据传递到 c# winform 中的文本框?
- c# - Xamarin 表单绑定列表
到选择器 - mysql - MySQL:如何仅在特定条件下使属性“可为空”
- node.js - docker-compose up 在 mac 上需要很多时间,但在 windows 上运行良好
- angular - Angular Material - 排除组件样式
- javascript - 谷歌地图移动应用(共享标记公开)
- html - 如何将标签中的两个图像彼此对齐?
- .htaccess - 为特定域重定向 301 htaccess
- css - 光滑的滑块在其他元素下移动