我们使用 SBT 插件获得了“成功”的构建,但胖 .jar 文件几乎缺少所有依赖项。与 Intellij 中的本地构建相比,该日志看起来是正确的。
.jar 的文件大小接近正确的构建,所以我们没有立即注意到问题,但显然校验和是错误的。
詹金斯罐子:
Intellij 中的本地构建:
部分日志:
[Deploy ContentSeasonalityScoring to Test] $ cmd.exe /C " java -Dsbt.log.noformat=true -jar d:\Jenk\tools\org.jvnet.hudson.plugins.SbtPluginBuilder_SbtInstallation\SBT_0.13.11\bin\sbt-launch.jar clean "
[info] Loading project definition from D:\Jenk\workspace\MarketingData\Deploy ContentSeasonalityScoring to Test\project
[info] Set current project to ContentSeasonalityScoring (in build file:/D:/Jenk/workspace/MarketingData/Deploy%20ContentSeasonalityScoring%20to%20Test/)
[success] Total time: 16 s, completed Aug 4, 2016 7:00:44 AM
Build step 'Build using sbt' changed build result to SUCCESS
[Deploy ContentSeasonalityScoring to Test] $ cmd.exe /C " java -Dsbt.log.noformat=true -jar d:\Jenk\tools\org.jvnet.hudson.plugins.SbtPluginBuilder_SbtInstallation\SBT_0.13.11\bin\sbt-launch.jar assembly "
[info] Loading project definition from D:\Jenk\workspace\MarketingData\Deploy ContentSeasonalityScoring to Test\project
[info] Set current project to ContentSeasonalityScoring (in build file:/D:/Jenk/workspace/MarketingData/Deploy%20ContentSeasonalityScoring%20to%20Test/)
[info] Updating
{file:/D:/Jenk/workspace/MarketingData/Deploy%20ContentSeasonalityScoring%20to%20Test/}
root...
[info] Resolving org.scala-lang#scala-library;2.10.5 ...
[info] Resolving org.apache.kafka#kafka-clients;0.8.2.1 ...
<etc...>
[info] Compiling 13 Scala sources to D:\Jenk\workspace\MarketingData\Deploy ContentSeasonalityScoring to Test\target\classes...
[info] Compiling 3 Scala sources to D:\Jenk\workspace\MarketingData\Deploy ContentSeasonalityScoring to Test\target\test-classes...
[info] Including: spark-csv_2.10-1.4.0.jar
[info] Including: scala-pickling_2.10-0.10.0.jar
[info] Including: kafka-clients-0.8.2.1.jar
[info] Including: commons-csv-1.1.jar
[info] Including: univocity-parsers-1.5.1.jar
[info] Including: slf4j-api-1.7.6.jar
[info] Including: lz4-1.2.0.jar
[info] Including: argonaut_2.10-6.1.jar
[info] Including: snappy-java-1.1.2.1.jar
[info] Including: quasiquotes_2.10-2.0.1.jar
[info] Including: joda-time-2.9.3.jar
[info] Including: scala-compiler-2.10.4.jar
[info] Including: scalaz-core_2.10-7.1.1.jar
[info] Including: joda-convert-1.8.1.jar
<successful tests...>
[info] Total number of tests run: 53
[info] Suites: completed 3, aborted 0
[info] Tests: succeeded 53, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[info] Including: monocle-core_2.10-1.1.0.jar
[info] Including: monocle-macro_2.10-1.1.0.jar
[info] Including: scallop_2.10-1.0.1.jar
[info] Including: scala-library.jar
[info] Including: scala-reflect.jar
[info] Checking every .class/.jar file's SHA-1.
[info] Merging files...
[warn] Merging 'NOTICE' with strategy 'rename'
[warn] Merging 'META-INF\NOTICE.txt' with strategy 'rename'
[warn] Merging 'org\xerial\snappy\native\README' with strategy 'rename'
[warn] Merging 'META-INF\LICENSE.txt' with strategy 'rename'
[warn] Merging 'LICENSE' with strategy 'rename'
[warn] Merging 'META-INF\MANIFEST.MF' with strategy 'discard'
[warn] Merging 'META-INF\maven\com.univocity\univocity-parsers\pom.properties' with strategy 'discard'
[warn] Merging 'META-INF\maven\com.univocity\univocity-parsers\pom.xml' with strategy 'discard'
[warn] Merging 'META-INF\maven\joda-time\joda-time\pom.properties' with strategy 'discard'
[warn] Merging 'META-INF\maven\joda-time\joda-time\pom.xml' with strategy 'discard'
[warn] Merging 'META-INF\maven\org.apache.commons\commons-csv\pom.properties' with strategy 'discard'
[warn] Merging 'META-INF\maven\org.apache.commons\commons-csv\pom.xml' with strategy 'discard'
[warn] Merging 'META-INF\maven\org.joda\joda-convert\pom.properties' with strategy 'discard'
[warn] Merging 'META-INF\maven\org.joda\joda-convert\pom.xml' with strategy 'discard'
[warn] Merging 'META-INF\maven\org.slf4j\slf4j-api\pom.properties' with strategy 'discard'
[warn] Merging 'META-INF\maven\org.slf4j\slf4j-api\pom.xml' with strategy 'discard'
[warn] Merging 'rootdoc.txt' with strategy 'concat'
[warn] Strategy 'concat' was applied to a file
[warn] Strategy 'discard' was applied to 11 files
[warn] Strategy 'rename' was applied to 5 files
[info] SHA-1: 88285925d1f4dc544e3e1abc5ac1c2a24fcde78c
[info] Packaging D:\Jenk\workspace\MarketingData\Deploy ContentSeasonalityScoring to Test\target\ContentSeasonalityScoring-assembly-1.0.jar ...
[info] Done packaging.
[success] Total time: 50 s, completed Aug 4, 2016 7:01:38 AM
如果作业无法到达 Maven 存储库,我预计会出现某种超时或失败。我们在这些服务器上运行作业,这些作业通过 http 引入 npm 依赖项。