ecplise中maven打包scala错误

六树枝出门 发布于 2017/12/06 12:19
阅读 592
收藏 0

ecplise中用maven打包scala项目错误问题,找不到原因,请知道的大神告知一下,错误如下:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Griffin :: Measures 0.1.5-incubating
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ measure ---
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ measure ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ measure ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-scala-plugin:2.15.2:compile (compile) @ measure ---
[INFO] Checking for multiple versions of scala
[WARNING]  Expected all dependencies to require Scala version: 2.10.6
[WARNING]  org.apache.griffin:measure:0.1.5-incubating requires scala version: 2.10.6
[WARNING]  com.twitter:chill_2.10:0.5.0 requires scala version: 2.10.4
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala👎 info: compiling
[INFO] Compiling 62 source files to D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\target\classes at 1512523980498
[WARNING] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\algo\BatchAccuracyAlgo.scala:164: warning: non-variable type argument String in type pattern Map[String,Any] is unchecked since it is eliminated by erasure
[INFO]         case vd: Map[String, Any] => getPersistMap(vd, targetPersist)
[INFO]                  ^
[ERROR] error: error while loading package, invalid LOC header (bad signature)
[ERROR] error: error while loading StructType, invalid LOC header (bad signature)
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\connector\AvroDataConnector.scala:60: error: value fields is not a member of org.apache.spark.sql.types.StructType
[INFO]       st.fields.map(f => (f.name, f.dataType.typeName))
[INFO]          ^
[ERROR] error: error while loading Row, invalid LOC header (bad signature)
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\connector\HiveDataConnector.scala:65: error: value getString is not a member of org.apache.spark.sql.Row
[INFO]       val originRows = sqlContext.sql(metaDataSql).map(r => (r.getString(0), r.getString(1))).collect
[INFO]                                                                ^
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\connector\HiveDataConnector.scala:65: error: value getString is not a member of org.apache.spark.sql.Row
[INFO]       val originRows = sqlContext.sql(metaDataSql).map(r => (r.getString(0), r.getString(1))).collect
[INFO]                                                                                ^
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\connector\HiveDataConnector.scala:66: error: value indexWhere is not a member of Array[Nothing]
[INFO]       val partitionPos: Int = originRows.indexWhere(pair => pair._1.startsWith("# "))
[INFO]                                          ^
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\connector\HiveDataConnector.scala:67: error: type mismatch;
[INFO]  found   : Array[Nothing]
[INFO]  required: Iterable[(String, String)]
[INFO]       if (partitionPos < 0) originRows
[INFO]                             ^
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\connector\HiveDataConnector.scala:68: error: value take is not a member of Array[Nothing]
[INFO]       else originRows.take(partitionPos)
[INFO]                       ^
[WARNING] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\persist\HdfsPersist.scala:37: warning: This catches all Throwables. If this is really intended, use `case _ : Throwable` to clear this warning.
[INFO]   val maxPersistLines = try { config.getOrElse(MaxPersistLines, -1).toString.toInt } catch { case _ => -1 }
[INFO]                                                                                                   ^
[WARNING] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\persist\HdfsPersist.scala:38: warning: This catches all Throwables. If this is really intended, use `case _ : Throwable` to clear this warning.
[INFO]   val maxLinesPerFile = try { config.getOrElse(MaxLinesPerFile, 10000).toString.toLong } catch { case _ => 10000 }
[INFO]                                                                                                       ^
[WARNING] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\persist\LoggerPersist.scala:32: warning: This catches all Throwables. If this is really intended, use `case _ : Throwable` to clear this warning.
[INFO]   val maxLogLines = try { config.getOrElse(MaxLogLines, 100).toString.toInt } catch { case _ => 100 }
[INFO]                                                                                            ^
[WARNING] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\rule\ExprValueUtil.scala:45: warning: fruitless type test: a value of type Any cannot also be a org.apache.spark.sql.Row
[INFO]             case Some(row: Row) => {
[INFO]                            ^
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\rule\ExprValueUtil.scala:48: error: value getAs is not a member of org.apache.spark.sql.Row
[INFO]                   case i: IndexDesc => Some(row.getAs[Any](i.index))
[INFO]                                                 ^
[ERROR] D:\java\ws_n_bigdata\griffin-parent-0.1.5-incubating\measure\src\main\scala\org\apache\griffin\measure\batch\rule\ExprValueUtil.scala:49: error: value getAs is not a member of org.apache.spark.sql.Row
[INFO]                   case f: FieldDesc => Some(row.getAs[Any](f.field))
[INFO]                                                 ^
[WARNING] 5 warnings found
[ERROR] 11 errors found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.983 s
[INFO] Finished at: 2017-12-06T09:33:07+08:00
[INFO] Final Memory: 30M/698M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.scala-tools:maven-scala-plugin:2.15.2:compile (compile) on project measure: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  

 

其中pom文件片段如下:

 <build>
    <plugins>
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>2.15.2</version>
        <executions>
          <execution>
            <id>compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <appendAssemblyId>false</appendAssemblyId>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

加载中
0
开源中国首席二哥
开源中国首席二哥

是不是 maven-scala-plugin 包没有。你可以右键-》maven->update Object。。。然后重新打包。你的错误太乱了。看的有点眼花

六树枝出门
六树枝出门
maven仓库中有maven-scala-plugin包,maven->update project操作做过无效
返回顶部
顶部