intel-analytics / analytics-zoo

Distributed Tensorflow, Keras and PyTorch on Apache Spark/Flink & Ray
https://analytics-zoo.readthedocs.io/
Apache License 2.0
16 stars 3 forks source link

make-dist all-in-one maven package error #843

Open Litchilitchy opened 4 years ago

Litchilitchy commented 4 years ago

I am using ./make-dist.sh -P all-in-one using master code, with maven 3.6.0 and maven 3.3.9, both raise following issue

[INFO] zoo-parent ......................................... SUCCESS [  0.609 s]
[INFO] analytics-zoo-bigdl_0.10.0-spark_2.4.3 ............. FAILURE [01:13 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:14 min
[INFO] Finished at: 2020-04-10T10:31:20+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.0.0:shade (without-spark) on project analytics-zoo-bigdl_0.10.0-spark_2.4.3: Error creating shaded jar: null: IllegalArgumentException -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :analytics-zoo-bigdl_0.10.0-spark_2.4.3
Litchilitchy commented 4 years ago

change spark-scope from provided to compile this error also occur

Litchilitchy commented 4 years ago

updated.

above error might well be caused by spark-core, I packaged spark-mlib and scala-lang.. to jar without spark-core and mvn package could build successfully.

However, the target jar has spark/ml/* dependencies in it but json4s and hadoop dependencies still not found. Seems they are in spark-mlib if I am right?

Litchilitchy commented 4 years ago

remove spark-core dependency in pom will build a runnable jar in IDE but make-dist will cause following error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.0.0:shade (without-spark) on project analytics-zoo-bigdl_0.10.0-spark_2.4.3: Error creating shaded jar: null: IllegalArgumentException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.0.0:shade (without-spark) on project analytics-zoo-bigdl_0.10.0-spark_2.4.3: Error creating shaded jar: null
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating shaded jar: null
        at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:546)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: java.lang.IllegalArgumentException
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.objectweb.asm.ClassReader.<init>(Unknown Source)
        at org.apache.maven.plugins.shade.DefaultShader.addRemappedClass(DefaultShader.java:418)
        at org.apache.maven.plugins.shade.DefaultShader.shadeSingleJar(DefaultShader.java:220)
        at org.apache.maven.plugins.shade.DefaultShader.shadeJars(DefaultShader.java:181)
        at org.apache.maven.plugins.shade.DefaultShader.shade(DefaultShader.java:104)
        at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:442)
        ... 22 more
[ERROR]
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :analytics-zoo-bigdl_0.10.0-spark_2.4.3