Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 无法识别的标签:';格式';_Maven - Fatal编程技术网

Maven 无法识别的标签:';格式';

Maven 无法识别的标签:';格式';,maven,Maven,我试图从我的项目中创建一个tar文件,其中包含项目JAR及其使用的库 为此,我使用了maven汇编插件,如下所述: 我有以下文件: 我已将以下内容复制粘贴到我的项目标签中: <formats> <format>tar.gz</format> </formats> <fileSets> <fileSet> <includes>

我试图从我的项目中创建一个tar文件,其中包含项目JAR及其使用的库

为此,我使用了
maven汇编插件
,如下所述:

我有以下文件:

我已将以下内容复制粘贴到我的
项目
标签中:

<formats>
        <format>tar.gz</format>
    </formats>

    <fileSets>
        <fileSet>
            <includes>
                <include>README*</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>src/bin</directory>
            <outputDirectory>bin</outputDirectory>
            <includes>
                <include>*.bat</include>
            </includes>
            <lineEnding>dos</lineEnding>
        </fileSet>
        <fileSet>
            <directory>src/bin</directory>
            <outputDirectory>bin</outputDirectory>
            <includes>
                <include>hello</include>
            </includes>
            <lineEnding>unix</lineEnding>
            <fileMode>0755</fileMode>
        </fileSet>
        <fileSet>
            <directory>target</directory>
            <outputDirectory>lib</outputDirectory>
            <includes>
                <include>generate-assembly-*.jar</include>
            </includes>
        </fileSet>
    </fileSets>

tar.gz
自述*
src/bin
箱子
*蝙蝠先生
磁盘操作系统
src/bin
箱子
你好
unix
0755
目标
解放党
生成程序集-*.jar
但是,我遇到了以下错误:

 Unrecognised tag: 'formats' (position: START_TAG seen ...</dependencies>\n\n\n    <formats>... @239:14)
无法识别的标记:'formats'(位置:START\u已看到标记…\n\n\n…@239:14)
为什么会出现这个错误

这应该是一个有效的标记,对吗?

标记进入程序集描述符文件,而不是项目文件。如果您再次查看发布的文档链接,它将指定文件的开头以:

<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">


maven的错误是因为您将它放在了
pom.xml
中。

您的pom中只包含了这些吗?那么应该封装这些配置的
标签呢?考虑到Maven错误,我怀疑它丢失了,因为
标记似乎跟在
标记后面。