IntelliJ 中的依赖关系没有得到解决
Dependencies are not getting resolved in IntelliJ
我已经导入了一个 Maven Java-selenium 项目,但由于某些原因这些依赖关系没有得到解决。我使用的版本是 3.1.0 enter image description here 。 Java 版本是 1.8 。感谢任何帮助。
首先关闭 IntelliJ - 尝试在 CMD 中工作。如果文件存在于您的用户目录中,请删除 settings.xml。
settings.xml 位置是 C:\Users\Nidhi\.m2 - 在 .m2 文件夹中你可以找到 seetings.xml 文件
添加环境变量:- M2_HOME, MAVEN_HOME - 这两个的路径是你系统中的maven文件夹
在环境变量“Path”中添加到 Maven 的 bin 文件夹的路径。例如:- C:\apache-maven-3.3.9\bin
打开CMD并cd到你有项目的文件夹
从这里开始 运行 mvn clean install
pom.xml
应该是这样的:
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.8.1</version>
<configuration>
...
<encoding>UTF-8</encoding>
...
</configuration>
</plugin>
</plugins>
...
</build>
</project>
或:
<project>
<properties>
<maven-resources-plugin.version>3.8.1</maven-resources-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<configuration>
...
<encoding>UTF-8</encoding>
...
</configuration>
</plugin>
</plugins>
...
</build>
</project>
编辑 pom.xml
文件后,在新建之前清理您的项目。
我已经导入了一个 Maven Java-selenium 项目,但由于某些原因这些依赖关系没有得到解决。我使用的版本是 3.1.0 enter image description here 。 Java 版本是 1.8 。感谢任何帮助。
首先关闭 IntelliJ - 尝试在 CMD 中工作。如果文件存在于您的用户目录中,请删除 settings.xml。
settings.xml 位置是 C:\Users\Nidhi\.m2 - 在 .m2 文件夹中你可以找到 seetings.xml 文件
添加环境变量:- M2_HOME, MAVEN_HOME - 这两个的路径是你系统中的maven文件夹 在环境变量“Path”中添加到 Maven 的 bin 文件夹的路径。例如:- C:\apache-maven-3.3.9\bin
打开CMD并cd到你有项目的文件夹
从这里开始 运行 mvn clean install
pom.xml
应该是这样的:
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.8.1</version>
<configuration>
...
<encoding>UTF-8</encoding>
...
</configuration>
</plugin>
</plugins>
...
</build>
</project>
或:
<project>
<properties>
<maven-resources-plugin.version>3.8.1</maven-resources-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<configuration>
...
<encoding>UTF-8</encoding>
...
</configuration>
</plugin>
</plugins>
...
</build>
</project>
编辑 pom.xml
文件后,在新建之前清理您的项目。