У меня есть искровой проект, основанный на scala и maven, я использовал плагин maven-assembly-plugin
для компиляции сторонней банки в мою банку.плагин в файле 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: он может хорошо работать на чужом компьютере.