解决Idea创建spark工程报错:Cannot resolve plugin org.scala-tools:maven-scala-plugin: unknown

不能解析plugin org。 scala工具:maven-scala-plugin:未知

解决Idea创建spark工程报错:Cannot resolve plugin org.scala-tools:maven-scala-plugin: unknown

解决方案:

首先:IDEA插件自动生成的pom文件中scala的版本是 2.7,需要修改成与本地scala一致的版本号,我的是2.12.10

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>cn.example</groupId>
  <artifactId>sparkrdd</artifactId>
  <version>1.0</version>
  <inceptionYear>2008</inceptionYear>
  <properties>
    <scala.version>2.12.10</scala.version>
    <spark.version>3.1.2</spark.version>
  </properties>

然后在 pom.xml 添加以下依赖

注意:与本地scala版本对应

<dependency>
      <groupId>org.scala-tools</groupId>
      <artifactId>maven-scala-plugin</artifactId>
      <version>2.12</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-eclipse-plugin</artifactId>
      <version>2.5.1</version>
    </dependency>

最后:在pom文件中右键 Maven-->Reimport ;

如果还失败;刷新缓存,重启IDEA。解决Idea创建spark工程报错:Cannot resolve plugin org.scala-tools:maven-scala-plugin: unknown

解决Idea创建spark工程报错:Cannot resolve plugin org.scala-tools:maven-scala-plugin: unknown

 

上一篇:无重叠区间(贪心算法)


下一篇:Manve