简体   繁体   English

执行Maven补丁发布

[英]Perform a maven patch release

Is it possible to perform a patch release in maven? 是否可以在Maven中执行补丁发布? I would like to create a jar containing only one class which I have changed since the release. 我想创建一个仅包含自发布以来已更改的类的jar。

There is no generic way to do that, as far as I know. 据我所知,没有通用的方法可以做到这一点。

However, the simplest way to do that is to create a simple assembly that will create a JAR or a ZIP containing your classes. 但是,最简单的方法是创建一个简单的程序集 ,该程序集将创建包含您的类的JAR或ZIP。 The assembly.xml will only need to include the specified class file: assembly.xml只需要包含指定的类文件:

<assembly>
    <formats>
        <format>zip</format>
    </formats>
    <files>
        <file>
            <source>target/classes/foo/bar/FooBar.class</source>
            <outputDirectory>foo/bar</outputDirectory>
        </file>
    </files>
</assembly>

(note that I didn't test this script) (请注意,我没有测试此脚本)

Then, after compiling ( mvn clean install ) your project, you will just need to run the command mvn assembly:assembly to create your ZIP file. 然后, 在编译mvn clean install )您的项目之后,您只需要运行命令mvn assembly:assembly即可创建您的ZIP文件。

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

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