Objenesis

A library for instantiating Java objects

License

License

Categories

Categories

Objenesis Application Layer Libs Introspection
GroupId

GroupId

org.objenesis
ArtifactId

ArtifactId

objenesis
Last Version

Last Version

3.2
Release Date

Release Date

Type

Type

jar
Description

Description

Objenesis
A library for instantiating Java objects
Project Organization

Project Organization

Joe Walnes, Henri Tremblay, Leonardo Mesquita

Download objenesis

How to add to project

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

Dependencies

test (2)

Group / Artifact Type Version
org.objenesis » objenesis-test jar 3.2
junit : junit jar 4.13.2

Project Modules

There are no modules declared in this project.

Objenesis

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.

Developer information

Project status

Build Status Maven Central

Environment setup

I'm using:

  • Maven 3.6.3
  • IntelliJ Ultimate 2021.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)

To build with Maven

There are two different levels of build.

Build without any active profile

It is a basic compilation of the application.

mvn install

Full build

This build will create the source and javadoc jars and run spotbugs.

mvn install -Pfull

To run special builds

Run the Android TCK

  • Install the Android SDK (brew cask install android-sdk)
  • Install platform-tools and build-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)))/../..")))
  • 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

Run the benchmarks

mvn package -Pbenchmark
cd benchmark
./launch.sh

Generate the website

mvn package -Pwebsite

To update the versions

  • mvn versions:set -DnewVersion=X.Y -Pall
  • mvn versions:commit -Pall if everything is ok, mvn versions:revert -Pall otherwise

Configure to deploy to the Sonatype maven repository

  • 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

To check dependencies and plugins versions

mvn versions:display-dependency-updates versions:display-plugin-updates -Pall

To upgrade the Maven wrapper

mvn -N io.takari:maven:wrapper -Dmaven=3.6.3

To update the license

mvn validate license:format -Pall

To release

  • Add the release notes in website/site/content/notes.html You use this code to generate it
# 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" | jq -r '.[] | "  <li>" + .title + " (#" + (.number|tostring) + ")</li>"'
echo "</ul>"
  • Launch an Android device (virtual or physical)
  • 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.

Deploy the website

  • Make sure the pom is at the version you want to release
  • Launch ./deploy-website.sh
org.objenesis

EasyMock

Versions

Version
3.2
3.1
3.0.1
3.0
2.6
2.5.1
2.5
2.4
2.3
2.2
2.1
2.0
1.4
1.3
1.2
1.1
1.0