CompileInfo

This library contains the CompileInfo annotation which provides a convenient way to get compile time information in a Java application.

License

License

Categories

Categories

Net
GroupId

GroupId

net.q2ek
ArtifactId

ArtifactId

compileinfo
Last Version

Last Version

1.0.0-rc1
Release Date

Release Date

Type

Type

jar
Description

Description

CompileInfo
This library contains the CompileInfo annotation which provides a convenient way to get compile time information in a Java application.
Project URL

Project URL

https://github.com/EdzeKruizinga/compileinfo
Source Code Management

Source Code Management

http://github.com/q2ek/compileinfo/tree/master

Download compileinfo

How to add to project

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

Dependencies

provided (1)

Group / Artifact Type Version
com.google.auto.service : auto-service jar 1.0-rc3

test (3)

Group / Artifact Type Version
org.assertj : assertj-core jar 3.6.2
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

CompileInfo

This Java library contains the CompileInfo annotation which provides a convenient way to get access to information that was available at compile-time.

More specifically it is an annotation processor that captures the time and system properties at compile time and stores them in a generated Java class. This is helpful for devops purposes, like in a delivery pipeline. It allows developers, operations and testers to know exactly when and where an application was built, if these properties are exposed by the application at runtime.

Usage

You will need to include compileinfo-${version}.jar in your build.

Usage with Maven:

In a Maven project, one would include the net.q2ek:compileinfo artifact as a provided dependency:

<dependency>
	<groupId>net.q2ek</groupId>
	<artifactId>compileinfo</artifactId>
	<version>1.0.0-rc1</version>
	<scope>provided</scope>
</dependency>

IDE support

To support annotation processing in your IDE see: https://immutables.github.io/apt.html

Examples

Example of typical basic usage:

import net.q2ek.compileinfo.CompileInfo;

@CompileInfo
class FirstExample {
	public String compileDateTime() {
		return FirstExampleCompileInfo.zonedDateTime().toString();
	}

	public String jenkinsBuildUrl() {
		return FirstExampleCompileInfo.getenv().get("BUILD_URL");
	}
}

All examples:

See example_output.md for the generated classes for these examples.

API

See API.md for the API description.

Built with

  • AutoService - Google Auto Service
  • Maven - Dependency Management and the project is a standard Maven project.
  • BCH compliance

Releases

See RELEASES.md for a list of the release history.

Authors

License

This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details.

net.q2ek

Versions

Version
1.0.0-rc1
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.1.0