Perform a maven patch release
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.
精彩评论