开发者

Perform a maven patch release

开发者 https://www.devze.com 2022-12-13 00:37 出处:网络
Is it pos开发者_JAVA百科sible to perform a patch release in maven? I would like to create a jar containing only one class which I have changed since the release.There is no generic way to do that, as

Is it pos开发者_JAVA百科sible to perform a patch release in maven? I would like to create a jar containing only one class which I have changed since the release.


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. The assembly.xml will only need to include the specified class file:

<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.

0

精彩评论

暂无评论...
验证码 换一张
取 消