执行目标org.apache.maven.plugins失败:maven-assemble-plugin(GroupId不能为空)

问题描述 投票:0回答:2

我对maven和Oozie非常陌生,当我使用命令时,

./mkdistro.sh -DskipTests -Dmaven.javadoc.skip=true
要从
Oozie-3.3.2
bin 文件夹构建 oozie,我收到一些类似这样的错误消息。
请帮助我,我无法找到有关此问题的任何答案。

我正在Ubuntu(12.04.4 LTS)上使用java 1.8(在

pom.xml
中,我已经将版本更改为1.8)和maven 3.2.5和hadoop版本1.2

    [INFO] Reactor Summary:
    [INFO] 
    [INFO] Apache Oozie Main .................................. SUCCESS [  2.785 s]
    [INFO] Apache Oozie Client ................................ SUCCESS [ 18.693 s]
    [INFO] Apache Oozie Hadoop 1.1.1.oozie-3.3.2 .............. SUCCESS [  1.592 s]
    [INFO] Apache Oozie Hadoop Distcp 1.1.1.oozie-3.3.2 ....... SUCCESS [  0.202 s]
    [INFO] Apache Oozie Hadoop 1.1.1.oozie-3.3.2 Test ......... SUCCESS [  0.369 s]
    [INFO] Apache Oozie Hadoop 2.0.2-alpha.oozie-3.3.2 ........ FAILURE [  0.241 s]
    [INFO] Apache Oozie Hadoop 2.0.2-alpha.oozie-3.3.2 Test ... SKIPPED
    [INFO] Apache Oozie Hadoop Distcp 2.0.2-alpha.oozie-3.3.2 . SKIPPED
    [INFO] Apache Oozie Hadoop Libs ........................... SKIPPED
    [INFO] Apache Oozie Hbase 0.94.2.oozie-3.3.2 .............. SKIPPED
    [INFO] Apache Oozie Hbase Libs ............................ SKIPPED
    [INFO] Apache Oozie Share Lib Pig ......................... SKIPPED
    [INFO] Apache Oozie Share Lib Streaming ................... SKIPPED
    [INFO] Apache Oozie Share Lib Distcp ...................... SKIPPED
    [INFO] Apache Oozie Share Lib Hive ........................ SKIPPED
    [INFO] Apache Oozie Share Lib Sqoop ....................... SKIPPED
    [INFO] Apache Oozie Share Lib Oozie ....................... SKIPPED
    [INFO] Apache Oozie Core .................................. SKIPPED
    [INFO] Apache Oozie Tests ................................. SKIPPED
    [INFO] Apache Oozie Tests For Pig ......................... SKIPPED
    [INFO] Apache Oozie Docs .................................. SKIPPED
    [INFO] Apache Oozie WebApp ................................ SKIPPED
    [INFO] Apache Oozie Examples .............................. SKIPPED
    [INFO] Apache Oozie Share Lib ............................. SKIPPED
    [INFO] Apache Oozie Tools ................................. SKIPPED
    [INFO] Apache Oozie MiniOozie ............................. SKIPPED
    [INFO] Apache Oozie Distro ................................ SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 26.145 s
    [INFO] Finished at: 2016-10-08T12:44:38-07:00
    [INFO] Final Memory: 33M/80M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (default-cli) on project oozie-hadoop: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. -> [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
    [ERROR] 
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :oozie-hadoop

    ERROR, Oozie distro creation failed

A part of 
Pom.xml
------------------------------------------------------------------------
    <build>
        <pluginManagement>
                <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.12</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <!-- Don't change version as doc generation may fail -->
                    <!-- (using custom doxia for twiki pages generation) -->
                    <version>2.0-beta-6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <version>0.8</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-clover2-plugin</artifactId>
                <configuration>
                    <licenseLocation>${clover.license}</licenseLocation>
                    <generateXml>true</generateXml>
                    <generateHtml>true</generateHtml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <configuration>
                    <xmlOutput>true</xmlOutput>
                    <findbugsXmlOutput>true</findbugsXmlOutput>
                    <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                </configuration>
            </plugin>

            <!-- checkstyle plugin. Execute 'mvn verify' and look for checkstyle-result.xml under target folder -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <consoleOutput>true</consoleOutput>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <configLocation>src/main/resources/checkstyle.xml</configLocation>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <rules>
                        <requireMavenVersion>
                            <version>[3.0.0,)</version>
                        </requireMavenVersion>
                        <requireJavaVersion>
                            <version>1.8</version>
                        </requireJavaVersion>
                        <requireOS>
                            <family>unix</family>
                        </requireOS>
                    </rules>
                </configuration>
                <executions>
                    <execution>
                        <id>clean</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>pre-clean</phase>
                    </execution>
                    <execution>
                        <id>default</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                    <execution>
                        <id>site</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>pre-site</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>${oozie.test.forkMode}</forkMode>
                    <forkedProcessTimeoutInSeconds>${test.timeout}</forkedProcessTimeoutInSeconds>
                    <argLine>-Xmx1024m -da -XX:MaxPermSize=512m</argLine>
                    <systemPropertyVariables>
                        <oozie.test.db.host>${oozie.test.db.host}</oozie.test.db.host>
                        <oozie.test.config.file>${oozie.test.config.file}</oozie.test.config.file>
                        <oozie.data.dir>${oozie.data.dir}</oozie.data.dir>
                    </systemPropertyVariables>
                    <environmentVariables>
                        <HADOOP_HOME>dummy</HADOOP_HOME>
                    </environmentVariables>
                    <excludes>
                        <exclude>**/${test.exclude}.java</exclude>
                        <exclude>${test.exclude.pattern}</exclude>

                        <!-- Explictly use -Dtest=TestSshActionExecutor,TestSshActionExecutorExtension
                             to test the SSH action
                        -->
                        <exclude>**/TestSsh*.java</exclude>

                        <!-- See 'testSqoop' profile in core/pom.xml and the Building doc-->
                        <exclude>**/TestSqoop*.java</exclude>

                        <!-- Explictly use -Dtest=TestMapReduceActionExecutorUberJar to test the uber jar functionality.
                             Requires at least Hadoop 1.2.0 or 2.2.0.
                        -->
                        <exclude>**/TestMapReduceActionExecutorUberJar.java</exclude>
                    </excludes>
                    <!-- DO NOT CHANGE THIS VALUES, TESTCASES CANNOT RUN IN PARALLEL -->
                    <parallel>classes</parallel>
                    <threadCount>1</threadCount>
                    <perCoreThreadCount>1</perCoreThreadCount>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assemblies/empty.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <configuration>
                    <excludeSubProjects>false</excludeSubProjects>
                    <excludes>
                        <exclude>**/*iml</exclude>
                        <exclude>release-log.txt</exclude>
                        <exclude>work.log</exclude>
                        <exclude>SecurityAuth.audit</exclude>
                        <exclude>.gitignore</exclude>
                        <exclude>docs/src/site/twiki/*.twiki</exclude>
                        <exclude>examples/src/main/data/*</exclude>
                        <exclude>core/src/test/resources/test-ioutils.txt</exclude>
                        <exclude>core/src/test/resources/PigMain.txt</exclude>
                        <exclude>webapp/src/main/resources/.gitignore</exclude>
                        <exclude>**/target/**</exclude>
                        <exclude>**/build/**</exclude>
                        <exclude>.git/**</exclude>
                        <exclude>test-patch/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

running with -X switch output
---------------------------------------------------------

    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (default-cli) on project oozie-hadoop: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (default-cli) on project oozie-hadoop: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        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:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        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.PluginExecutionException: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
    Caused by: org.apache.maven.artifact.InvalidArtifactRTException: For artifact {null:null:null:jar}: The groupId cannot be empty.
        at org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:130)
        at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:123)
        at org.apache.maven.bridge.MavenRepositorySystem.XcreateArtifact(MavenRepositorySystem.java:700)
        at org.apache.maven.bridge.MavenRepositorySystem.XcreateArtifact(MavenRepositorySystem.java:660)
        at org.apache.maven.bridge.MavenRepositorySystem.XcreateArtifact(MavenRepositorySystem.java:654)
        at org.apache.maven.bridge.MavenRepositorySystem.XcreateArtifact(MavenRepositorySystem.java:612)
        at org.apache.maven.bridge.MavenRepositorySystem.createArtifact(MavenRepositorySystem.java:98)
        at org.apache.maven.project.DefaultProjectBuilder.initProject(DefaultProjectBuilder.java:697)
        at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:174)
        at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:364)
        at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:284)
        at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:577)
        at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:190)
        at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:532)
        at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect(DefaultLegacyArtifactCollector.java:144)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:484)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveWithExceptions(DefaultArtifactResolver.java:340)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:334)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:309)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:278)
        at org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolver.resolveTransitively(DefaultDependencyResolver.java:206)
        at org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:128)
        at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:183)
        at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:413)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
        ... 20 more
    [ERROR] 
    [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
    [ERROR] 
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :oozie-hadoop

    ERROR, Oozie distro creation failed
maven hadoop oozie
2个回答
0
投票

看起来像一个合法的 Maven bug。 https://issues.apache.org/jira/browse/MASSEMBLY-841

看起来最新版本中有修复,但不一定是最新版本。

我在尝试构建 Luke 时遇到了这个问题。 https://github.com/DmitryKey/luke


0
投票

正如错误行所示:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (default-cli) on project oozie-hadoop: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single failed: For artifact {null:null:null:jar}: The groupId cannot be empty. -> [Help 1] 

您刚刚错过了

maven-assembly-plugin
声明中的 groupId 元素:

<groupId>org.apache.maven.plugins</groupId>

完整的插件声明必须是:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-assembly-plugin</artifactId>
   <configuration>
       <descriptors>
          <descriptor>src/main/assemblies/empty.xml</descriptor>
       </descriptors>
   </configuration>
</plugin>
© www.soinside.com 2019 - 2024. All rights reserved.