Apache CXF XJC #hashCode and #equals plugin

A plugin for CXF codegen plugin that adds `#hashCode` and `#equals` implementations with zero runtime dependencies for the generated classes.

License

License

GroupId

GroupId

com.viskan
ArtifactId

ArtifactId

cxf-xjc-hce
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Apache CXF XJC #hashCode and #equals plugin
A plugin for CXF codegen plugin that adds `#hashCode` and `#equals` implementations with zero runtime dependencies for the generated classes.
Project Organization

Project Organization

Viskan System AB
Source Code Management

Source Code Management

https://github.com/viskan/cxf-xjc-hce

Download cxf-xjc-hce

How to add to project

<!-- https://jarcasting.com/artifacts/com.viskan/cxf-xjc-hce/ -->
<dependency>
    <groupId>com.viskan</groupId>
    <artifactId>cxf-xjc-hce</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.viskan/cxf-xjc-hce/
implementation 'com.viskan:cxf-xjc-hce:1.0.0'
// https://jarcasting.com/artifacts/com.viskan/cxf-xjc-hce/
implementation ("com.viskan:cxf-xjc-hce:1.0.0")
'com.viskan:cxf-xjc-hce:jar:1.0.0'
<dependency org="com.viskan" name="cxf-xjc-hce" rev="1.0.0">
  <artifact name="cxf-xjc-hce" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.viskan', module='cxf-xjc-hce', version='1.0.0')
)
libraryDependencies += "com.viskan" % "cxf-xjc-hce" % "1.0.0"
[com.viskan/cxf-xjc-hce "1.0.0"]

Dependencies

provided (2)

Group / Artifact Type Version
org.glassfish.jaxb : jaxb-xjc jar 2.3.2
org.glassfish.jaxb : jaxb-runtime jar 2.3.2

Project Modules

There are no modules declared in this project.

CXF XJC hashCode and equals plugin

A plugin for CXF codegen plugin that adds #hashCode and #equals implementations with zero runtime dependencies for the generated classes.

If you are looking for a library that generates #toString, we recommend you to take a look at Apache CXF XJC Utils. It does have a dependency, but it's Apache Commons Lang3, which is commonly used anyway.

Usage

Example profile in pom.xml:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${cxf.version}</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                        <configuration>
                            <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>...</wsdl>
                                    <extraargs>
                                        <extraarg>-xjc-Xhashcode-equals</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.viskan</groupId>
                        <artifactId>cxf-xjc-hce</artifactId>
                        <version>1.0.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

And generate as usual:

$ mvn generate-sources -Pgenerate

Releasing

Majors and minors:

$ mvn versions:set versions:set-scm-tag -DnewVersion=1.0.0 -DnewTag=v1.0.0 -DgenerateBackupPoms=false
$ git add pom.xml && commit -m "release: 1.0.0"
$ git tag v1.0.0
$ mvn deploy -Psonatype-oss-release
$ mvn versions:set versions:set-scm-tag -DnewVersion=1.1.0-SNAPSHOT -DnewTag=HEAD -DgenerateBackupPoms=false
$ git add pom.xml && commit -m "chore: Prepare for the next development iteration"
$ git push origin master && git push origin v1.0.0

Patches:

$ git checkout v1.0.0
$ git cherry-pick <Commit SHA of whatever commit you want to patch in>
$ mvn versions:set versions:set-scm-tag -DnewVersion=1.0.1 -DnewTag=v1.0.1 -DgenerateBackupPoms=false
$ git add pom.xml && commit -m "release: 1.0.1"
$ git tag v1.0.1
$ mvn deploy -Psonatype-oss-release
$ git push origin v1.0.1

License

Apache License 2.0 © Viskan System AB

com.viskan

Viskan System AB

Versions

Version
1.0.0