views:

88

answers:

1

Is it possible 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.

A: 

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.

romaintaz