繁体   English   中英

Maven Shade插件将文件重定位到主文件夹

[英]Maven shade plugin relocate file to main folder

我正在使用maven-shade-plugin版本3.2.1包含/排除某些类。 我正在尝试将文件夹内的文件重定位到jar中的主文件夹。

<configuration>
        <filters>
                ...
        </filters>
        <relocations>
                <relocation>
                        <pattern>org/example</pattern>
                        <shadedPattern>org/example/example2</shadedPattern>
                </relocation>
        </relocations>
</configuration>

如果我如上所述使用它,它将把org.example下的文件移动到org.example.example2 (只是为了确保它可以正常工作)。 如果我仅使用“ /”,那么它将创建具有空名称的文件夹和子文件夹,并将文件放在其下。 如果我保持</shadedPattern>空,则什么也不会发生。

我想将文件放在主目录中,但到目前为止我还做不到。

有什么办法可以通过阴影插件或其他方式实现这一目标?

谢谢

据我所知,您应该对以下阴影图案使用./

<configuration>
    <filters>
            ...
    </filters>
    <relocations>
            <relocation>
                    <pattern>org/example</pattern>
                    <shadedPattern>./</shadedPattern>
            </relocation>
    </relocations>

希望能帮助到你!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM