詹金斯的SBT插件创造了空的胖罐

时间:2016-08-04 19:17:48

标签: jenkins sbt-plugin

我们得到了成功"使用SBT插件构建,但胖.jar文件几乎缺少所有依赖项。与Intellij中的本地构建相比,日志看起来是正确的。

.jar的文件大小接近正确的构建,所以我们没有立即注意到问题,但显然校验和错误。

Jenkins jar:

This is the result from Jenkins

Intellij中的本地构建:

This is a good build

部分日志:

[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依赖项

1 个答案:

答案 0 :(得分:0)

嗯......没关系。

我们使用带有ssh任务的发布将.jar移动到目标Linux服务器。作为该任务的一部分,我们将所有Windows文件结尾转换为Unix文件结尾,但这应该仅针对文本文件进行。我们无意中将相同的命令应用于.jar文件。

不要这样做。