For a high level overview refer to my blog.
Refer to the maven artifact
<dependency>
<groupId>com.github.ruediste</groupId>
<artifactId>polymorphic-gson</artifactId>
<version>...</version>
</dependency>
Then register the type adapter when you create your Gson instance:
new GsonBuilder().registerTypeAdapterFactory(
PolymorphStyle.TYPE_PROPERTY,
getClass().getClassLoader(),
"your.package.prefix.to.scan"))
...
.create();
Use
mvn versions:set -DnewVersion=0.1
Push to the release
branch. A github action will automatically pick this up and publish the artifacts. Then run a
mvn versions:set -DnewVersion=0.2-SNAPSHOT
and push to master.