我有一个基于scala和maven的spark项目,我使用插件maven-assembly-plugin
将第三方jar编译到我的jar中。
My pom.xml文件中的插件是:
<!--这个插件允许打包时包含上游依赖-->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- this is used for inheritance merges -->
<phase>package</phase>
<!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
当我没有添加它时,它运行良好,但是当我添加它时会收到错误信息。
命令是:mvn package
错误日志是:
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sensitivity ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/dainping/Documents/GitCode/sensitivity/src/main/resources
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:compile (default) @ sensitivity ---
[INFO] Checking for multiple versions of scala
[INFO] artifact com.google.guava:guava: checking for updates from meituan-dianping
[WARNING] Expected all dependencies to require Scala version: 2.11.8
[WARNING] org.json4s:json4s-core_2.11:3.2.11 requires scala version: 2.11.0
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sensitivity ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default) @ sensitivity ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:compile (compile) @ sensitivity ---
[INFO] Checking for multiple versions of scala
[INFO] artifact com.google.guava:guava: checking for updates from meituan-dianping
[WARNING] Expected all dependencies to require Scala version: 2.11.8
[WARNING] org.json4s:json4s-core_2.11:3.2.11 requires scala version: 2.11.0
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scala-maven-plugin:3.2.1:compile (default) @ sensitivity ---
[INFO] artifact com.google.guava:guava: checking for updates from meituan-dianping
[WARNING] Expected all dependencies to require Scala version: 2.11.8
[WARNING] org.json4s:json4s-core_2.11:3.2.11 requires scala version: 2.11.0
[WARNING] Multiple versions of scala libraries detected!
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ sensitivity ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/dainping/Documents/GitCode/sensitivity/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ sensitivity ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:testCompile (test-compile) @ sensitivity ---
[INFO] Checking for multiple versions of scala
[INFO] artifact com.google.guava:guava: checking for updates from meituan-dianping
[WARNING] Expected all dependencies to require Scala version: 2.11.8
[WARNING] org.json4s:json4s-core_2.11:3.2.11 requires scala version: 2.11.0
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[WARNING] No source files found.
[INFO]
[INFO] --- scala-maven-plugin:3.2.1:testCompile (default) @ sensitivity ---
[INFO] artifact com.google.guava:guava: checking for updates from meituan-dianping
[WARNING] Expected all dependencies to require Scala version: 2.11.8
[WARNING] org.json4s:json4s-core_2.11:3.2.11 requires scala version: 2.11.0
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ sensitivity ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ sensitivity ---
[INFO]
[INFO] --- maven-assembly-plugin:2.5:single (make-assembly) @ sensitivity ---
[INFO] artifact com.google.guava:guava: checking for updates from meituan-dianping
[INFO] Building jar: /Users/dainping/Documents/GitCode/sensitivity/target/sensitivity-1.0-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.760 s
[INFO] Finished at: 2018-05-15T19:46:05+08:00
[INFO] Final Memory: 67M/660M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5:single (make-assembly) on project sensitivity: Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:2.5:single failed.: NullPointerException -> [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/PluginExecutionException
任何人都知道我的案子哪里出错了?
PS:它可以在其他人身上很好用。计算机。