Versioning Maven Plugin

Generates a source code file with information from your SCM. This makes it easy to show this information inside your application.

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка Сеть
Группа

Группа

net.tietema.versioning
Идентификатор

Идентификатор

versioning-maven-plugin
Последняя версия

Последняя версия

1.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Versioning Maven Plugin
Generates a source code file with information from your SCM. This makes it easy to show this information inside your application.
Ссылка на сайт

Ссылка на сайт

http://github.com/jtietema/versioning-maven-plugin
Система контроля версий

Система контроля версий

https://github.com/jtietema/versioning-maven-plugin

Скачать versioning-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>net.tietema.versioning</groupId>
    <artifactId>versioning-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 2.0
org.codehaus.plexus : plexus-utils jar 3.0.8
org.eclipse.jgit : org.eclipse.jgit jar 2.3.1.201302201838-r
com.squareup : javawriter jar 1.0.4
org.apache.maven : maven-project jar 2.0.9

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.8.2

Модули Проекта

Данный проект не имеет модулей.

Versioning maven plugin

A Maven plugin that generates a small Java file with some revision info from git. This plugin makes it easy to show info from your git repository inside your app. This makes it possible to trace a build back to the exact revision and state the repository was in when the build was made.

An example of the output:

public final class Version {
  public static final String BRANCH = "master";
  public static final String REVISION = "2f6422230fc18cb427eeb9f6201e83db3adb0f24";
  public static final String REVISION_SHORT = "2f642223";
  /**
   * Strict Clean means no changes, not even untracked files
   */
  public static final boolean STRICT_CLEAN = false;
  /**
   * Lose Clean means no changes except untracked files.
   */
  public static final boolean LOSE_CLEAN = false;
}

How to use

Add the following to you section of your pom file.

<plugin>
    <groupId>net.tietema.versioning</groupId>
    <artifactId>versioning-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>git-java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <packageName>com.example</packageName>
        <className>VersionInfo</className>
    </configuration>
</plugin>

The plugin will the run before each maven compile and generate an up to date version of the file. You can then reference the static fields of the class directly into your code.

Notes

  • It is not recommended to commit this file to your SCM.
  • If you build your code directly in your IDE it will probably not directly execute maven, but rather just copy configuration. In that case you need to make sure that the verionsing-maven-plugin:git-java goal runs before the build/make step of your IDE.

Bugs, Contributions and Feedback

All collaboration is done on Github. If you have any suggestions, bugs or contributions, please contact me via Github. Futher enhancesments could be: adding more SCM's or maybe adding more JVM output languages.

License

This plugin is distributed under the Apache License version 2.0

Версии библиотеки

Версия
1.0