Objenesis is a library dedicated to bypass the constructor when creating an object. On any JVM there is.
You can find the website and user documentation at objenesis.org.
I'm using:
- Maven 3.9.6
- IntelliJ Ultimate 2024.1 (thanks to JetBrains for the license) (it should also work with Eclipse)
To configure your local workspace:
- Import the Maven parent project to Eclipse or IntelliJ
- Import the Eclipse formatting file
objenesis-formatting.xml
(usable in Eclipse or IntelliJ)
There are two different levels of build.
It is a basic compilation of the application.
mvn install
This build will create the source and javadoc jars and run spotbugs.
mvn install -Pfull
- Install the Android SDK (
brew cask install android-sdk
) - Install
platform-tools
andbuild-tools
using the sdkmanager (sdkmanager "platform-tools" "build-tools"
) - Add an
ANDROID_HOME
to target the Android SDK (export ANDROID_HOME=$(realpath $(echo "$(dirname $(readlink $(which sdkmanager)))/../.."))
)
- Install Android Studio
- Launch studio and install SDK and emulator
- Add an
ANDROID_HOME
to environmental variables (path used to install SDK on previous step)
- Configure a device (real or simulated) and launch it (use API 26, after that it asks for a signature, that isn't supported yet)
- Activate the debug mode if it's a real device
mvn package -Pandroid
mvn package -Pbenchmark
cd benchmark
./launch.sh
mvn package -Pwebsite
mvn versions:set -DnewVersion=X.Y -Pall
mvn versions:commit -Pall
if everything is ok,mvn versions:revert -Pall
otherwise
- You will first need to add something like this to your settings.xml
<servers>
<server>
<id>ossrh</id>
<username>sonatypeuser</username>
<password>sonatypepassword</password>
</server>
</servers>
- Then follow the instructions from the site below to create your key to sign the deployed items
mvn versions:display-dependency-updates versions:display-plugin-updates -Pall
mvn wrapper:wrapper
mvn validate license:format -Pall
mvn modernizer:modernizer -Pall
We make sure a build will always create the same result with done from the same sources. It follows these guidelines.
Useful commands:
# Checks that all plugins are compatible
mvn artifact:check-buildplan -Pfull,all
# Build and install the artifact
mvn clean install -Pfull,all
# Build and compare the artifact with the installed one
mvn clean verify artifact:compare -Pfull,all
- Add the release notes in
website/site/content/notes.html
You use this code to generate it. If you have more than 100 items, do it again with&page=2
# Get the milestone matching the version
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d'-' -f1)
milestone=$(curl -s "https://api.github.com/repos/easymock/objenesis/milestones" | jq ".[] | select(.title==\"$version\") | .number")
echo "<h1>Version $version ($(date '+%Y-%m-%d'))</h1>"
echo
echo "<ul>"
curl -s "https://api.github.com/repos/easymock/objenesis/issues?milestone=${milestone}&state=all&per_page=100" | jq -r '.[] | " <li>" + .title + " (#" + (.number|tostring) + ")</li>"'
echo "</ul>"
- Make sure you have Java 9+ in the path
- Launch
./deploy.sh
- Answer the questions (normally, just acknowledge the proposed default)
- Follow the instructions
If something fails, and you need to rollback a bit, the following commands might help:
mvn release:rollback -Pall
git tag -d $version
git push origin :refs/tags/$version
git reset --hard HEAD~2
If you find something went wrong you can drop the staging repository with mvn nexus-staging:drop
.
- Make sure the pom is at the version you want to release
- Launch
./deploy-website.sh