Version Injection Plugin for Gradle

Gradle plugin for dynamic injection of the project version into classes (bytecode manipulation)

License

License

Categories

Categories

Gradle Build Tools Hibernate Data ORM
GroupId

GroupId

org.hibernate.build.gradle
ArtifactId

ArtifactId

version-injection-plugin
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Version Injection Plugin for Gradle
Gradle plugin for dynamic injection of the project version into classes (bytecode manipulation)
Project URL

Project URL

http://hibernate.org
Project Organization

Project Organization

Hibernate.org
Source Code Management

Source Code Management

http://github.com/hibernate/version-injection-plugin

Download version-injection-plugin

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.javassist : javassist jar 3.18.1-GA

Project Modules

There are no modules declared in this project.

version-injection-plugin

Gradle plugin used by Hibernate to inject project version into compiled classes

To use you'd simply apply the plugin (after making sure it is added to your buildscript classpath):

buildscript {
    ...
    dependencies {
        classpath 'org.hibernate.build.gradle:version-injection-plugin:${theVersionToUse}'
    }
}

apply plugin: 'version-injection'

Then, you'd configure it. Configuration mainly involves naming the Class member to inject the project version into:

versionInjection {
    into( 'com.acme.Version', 'getVersionString' )
}

The above would instruct the plugin to over-write the body of com.acme.Version.getVersionString() method with the project's current version. The plugin does this through bytecode manipulation. The injection is performed every time the compileJava task is performed (as a doLast action).

org.hibernate.build.gradle

Hibernate

Versions

Version
1.0.0