• [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (make-assembly) on project hive-udf: Error reading assemblies: No assembly descriptors found. -> [Help 1]


    自己在使用maven进行package操作时出现
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (make-assembly) on project hive-udf: Error reading assemblies: No assembly descriptors found. -> [Help 1]
    错误。
    通过报错信息,应该是maven-assembly-plugin的元素没有指定。
    解决方案:
    第1步:
    把原来的内容:

    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <descriptors></descriptors>
            <finalName>hive-udf</finalName>
            <outputDirectory>${project.build.directory}/../..</outputDirectory>
            <appendAssemblyId>false</appendAssemblyId>
        </configuration>
        <executions>
            <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                    <goal>single</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    

    修改为

    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <descriptors>../jar.xml</descriptors>
            <finalName>hive-udf</finalName>
            <outputDirectory>${project.build.directory}/../..</outputDirectory>
            <appendAssemblyId>false</appendAssemblyId>
        </configuration>
        <executions>
            <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                    <goal>single</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    

    第2步:在项目的根目录添加jar.xml

    <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
      <id>jar</id>
      <formats>
        <format>jar</format>
      </formats>
      <includeBaseDirectory>false</includeBaseDirectory>
      <dependencySets>
        <dependencySet>
          <outputDirectory>/</outputDirectory>
          <useProjectArtifact>true</useProjectArtifact>
          <unpack>true</unpack>
          <scope>runtime</scope>
          <useTransitiveDependencies>false</useTransitiveDependencies>
          <includes>
            <include>brucedu.bigdata:*</include>
          </includes>
        </dependencySet>
      </dependencySets>
      <fileSets>
        <fileSet>
          <directory>target/classes</directory>
          <outputDirectory>/</outputDirectory>
        </fileSet>
      </fileSets>
    </assembly>
    

    重新执行package命令,BUILD SUCCESS!

  • 相关阅读:
    用redis实现分布式锁
    mac下Nginx+lua模块编译安装
    ESXi5 中克隆Linux虚拟主机的网络配置
    DOS命令中的For
    让delphi解析chrome扩展的native应用
    C语言 cgi(3)
    C语言 cgi(2)
    C语言cgi(1)
    c++ input,output
    Array of Objects
  • 原文地址:https://www.cnblogs.com/DataNerd/p/8974426.html
Copyright © 2020-2023  润新知