问题
I'm trying to install the Oozie 5.2.0 with java version "1.8.0_221" and maven version 3.6.3. After I unzip the Oozie file I put the following command:
bin/mkdistro.sh assembly:single -P hadoop-2,uber -Dmaven.test.skip=true -Dhadoop.version=2.7.4 -Dhive.version=2.1.1 -e
But, I got the following response and failed:
[INFO] Reactor Summary for Apache Oozie Main 5.2.0:
[INFO]
[INFO] Apache Oozie Main .................................. SUCCESS [ 34.428 s]
[INFO] Apache Oozie Fluent Job ............................ SUCCESS [ 1.432 s]
[INFO] Apache Oozie Fluent Job API ........................ SUCCESS [03:57 min]
[INFO] Apache Oozie Client ................................ SUCCESS [ 54.766 s]
[INFO] Apache Oozie Share Lib Oozie ....................... SUCCESS [ 54.476 s]
[INFO] Apache Oozie Share Lib HCatalog .................... SUCCESS [01:54 min]
[INFO] Apache Oozie Share Lib Distcp ...................... SUCCESS [ 1.077 s]
[INFO] Apache Oozie Core .................................. SUCCESS [01:17 min]
[INFO] Apache Oozie Share Lib Streaming ................... SUCCESS [ 3.926 s]
[INFO] Apache Oozie Share Lib Pig ......................... SUCCESS [ 20.455 s]
[INFO] Apache Oozie Share Lib Git ......................... SUCCESS [ 27.174 s]
[INFO] Apache Oozie Share Lib Hive ........................ SUCCESS [ 16.983 s]
[INFO] Apache Oozie Share Lib Hive 2 ...................... SUCCESS [ 5.118 s]
[INFO] Apache Oozie Share Lib Sqoop ....................... SUCCESS [ 2.575 s]
[INFO] Apache Oozie Examples .............................. SUCCESS [ 28.794 s]
[INFO] Apache Oozie Share Lib Spark ....................... SUCCESS [ 46.099 s]
[INFO] Apache Oozie Share Lib ............................. SUCCESS [ 50.426 s]
[INFO] Apache Oozie Docs .................................. SUCCESS [ 5.787 s]
[INFO] Apache Oozie WebApp ................................ SUCCESS [ 6.922 s]
[INFO] Apache Oozie Tools ................................. SUCCESS [ 1.853 s]
[INFO] Apache Oozie MiniOozie ............................. SUCCESS [ 1.952 s]
[INFO] Apache Oozie Fluent Job Client ..................... SUCCESS [ 1.992 s]
[INFO] Apache Oozie Server ................................ SUCCESS [ 7.648 s]
[INFO] Apache Oozie Distro ................................ FAILURE [ 1.837 s]
[INFO] Apache Oozie ZooKeeper Security Tests .............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13:46 min
[INFO] Finished at: 2020-01-28T06:13:54+09:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "hadoop-2" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.1.0:single (default-cli) on project oozie-distro: Failed to create assembly: Error adding file to archive: /Users/a1101256/Downloads/oozie-5.2.0/distro/./../core/target/oozie-core-5.2.0-tests.jar -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.1.0:single (default-cli) on project oozie-distro: Failed to create assembly: Error adding file to archive: /Users/a1101256/Downloads/oozie-5.2.0/distro/./../core/target/oozie-core-5.2.0-tests.jar
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create assembly: Error adding file to archive: /Users/a1101256/Downloads/oozie-5.2.0/distro/./../core/target/oozie-core-5.2.0-tests.jar
at org.apache.maven.plugins.assembly.mojos.AbstractAssemblyMojo.execute (AbstractAssemblyMojo.java:532)
at org.apache.maven.plugins.assembly.mojos.SingleAssemblyMojo.execute (SingleAssemblyMojo.java:61)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugins.assembly.archive.ArchiveCreationException: Error adding file to archive: /Users/a1101256/Downloads/oozie-5.2.0/distro/./../core/target/oozie-core-5.2.0-tests.jar
at org.apache.maven.plugins.assembly.archive.phase.FileItemAssemblyPhase.execute (FileItemAssemblyPhase.java:131)
at org.apache.maven.plugins.assembly.archive.DefaultAssemblyArchiver.createArchive (DefaultAssemblyArchiver.java:181)
at org.apache.maven.plugins.assembly.mojos.AbstractAssemblyMojo.execute (AbstractAssemblyMojo.java:478)
at org.apache.maven.plugins.assembly.mojos.SingleAssemblyMojo.execute (SingleAssemblyMojo.java:61)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.nio.file.NoSuchFileException: /Users/a1101256/Downloads/oozie-5.2.0/distro/./../core/target/oozie-core-5.2.0-tests.jar
at sun.nio.fs.UnixException.translateToIOException (UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews$Posix.readAttributes (UnixFileAttributeViews.java:218)
at sun.nio.fs.UnixFileAttributeViews$Unix.readAttributes (UnixFileAttributeViews.java:345)
at sun.nio.fs.AbstractFileSystemProvider.readAttributes (AbstractFileSystemProvider.java:92)
at java.nio.file.Files.readAttributes (Files.java:1964)
at org.codehaus.plexus.components.io.attributes.FileAttributes.<init> (FileAttributes.java:67)
at org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributeUtils.getFileAttributesByPath (PlexusIoResourceAttributeUtils.java:203)
at org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributeUtils.getFileAttributes (PlexusIoResourceAttributeUtils.java:165)
at org.codehaus.plexus.components.io.resources.ResourceFactory.createResource (ResourceFactory.java:40)
at org.apache.maven.plugins.assembly.archive.phase.FileItemAssemblyPhase.execute (FileItemAssemblyPhase.java:120)
at org.apache.maven.plugins.assembly.archive.DefaultAssemblyArchiver.createArchive (DefaultAssemblyArchiver.java:181)
at org.apache.maven.plugins.assembly.mojos.AbstractAssemblyMojo.execute (AbstractAssemblyMojo.java:478)
at org.apache.maven.plugins.assembly.mojos.SingleAssemblyMojo.execute (SingleAssemblyMojo.java:61)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[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 <args> -rf :oozie-distro
ERROR, Oozie distro creation failed
I have changed Maven version but it didn't work. I spent a whole night to make it work but other versions are also frustrating with so many errors(I did not think that it'll take that much time to just install a package). Any idea?
回答1:
I finally avoid the error by disabling test jar on distro.xml of oozie. So, the Dockerfile like
FROM bde2020/hadoop-base:2.0.0-hadoop2.7.4-java8
ENV MAVEN_VERSION 3.6.3
ENV OOZIE_VERSION 5.2.0
ARG PKG_HOME=/opt
ARG OOZIE_BUILD_HOME=$PKG_HOME/oozie-release-$OOZIE_VERSION
ARG MAVEN_URL=http://xenia.sote.hu/ftp/mirrors/www.apache.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz
ARG OOZIE_URL=https://github.com/apache/oozie/archive/release-$OOZIE_VERSION.tar.gz
ENV OOZIE_HOME $PKG_HOME/oozie-$OOZIE_VERSION
ENV PATH $PATH:$OOZIE_HOME/bin
RUN apt-get install -y --no-install-recommends \
unzip
RUN set -x \
&& curl -fSL "$MAVEN_URL" -o /tmp/maven.tar.gz \
&& curl -fSL "$OOZIE_URL" -o /tmp/oozie.tar.gz \
&& tar -xvf /tmp/maven.tar.gz -C $PKG_HOME/ \
&& tar -xvf /tmp/oozie.tar.gz -C $PKG_HOME/ \
&& rm /tmp/*.tar.gz
COPY oozie/distro.xml $OOZIE_BUILD_HOME/src/main/assemblies/distro.xml
RUN export PATH=/opt/apache-maven-$MAVEN_VERSION/bin:$PATH \
&& cd $OOZIE_BUILD_HOME \
&& bin/mkdistro.sh assembly:single -P uber -Dmaven.test.skip=true -DskipTests -Dhadoop.version="2.7.4" -Dhive.version="2.1.1" \
&& mv $OOZIE_BUILD_HOME/distro/target/oozie-$OOZIE_VERSION-distro.tar.gz $PKG_HOME/ && cd $PKG_HOME && tar xfv oozie-$OOZIE_VERSION-distro.tar.gz && rm oozie-$OOZIE_VERSION-distro.tar.gz \
&& rm -fR $OOZIE_BUILD_HOME \
&& rm -fR $PKG_HOME/apache-maven-$MAVEN_VERSION \
&& rm -fR ~/.m2
RUN mkdir -p /var/log/oozie \
&& mkdir -p /var/lib/oozie/data \
&& ln -s /var/log/oozie $OOZIE_HOME/log \
&& ln -s /var/lib/oozie/data $OOZIE_HOME/data
RUN mkdir $OOZIE_HOME/libext \
&& curl http://archive.cloudera.com/gplextras/misc/ext-2.2.zip -o $OOZIE_HOME/libext/ext-2.2.zip
RUN cp /etc/hadoop/core-site.xml $OOZIE_HOME/conf/hadoop-conf/core-site.xml
COPY oozie/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 11000 11001
ENTRYPOINT ["entrypoint.sh"]
And, I comment out Oozie core test jar part of distro.xml
<!-- Oozie core test jar -->
<!-- <file>-->
<!-- <source>${basedir}/../core/target/oozie-core-${project.version}-tests.jar</source>-->
<!-- <outputDirectory>/oozie-core</outputDirectory>-->
<!-- </file>-->
<!-- Oozie Documentation -->
来源:https://stackoverflow.com/questions/59940474/oozie-build-fail-failed-to-execute-goal-org-apache-maven-pluginsmaven-assembly