Enumeration Generator Maven Plugin

A maven plugin that generates Java enums from properties files

Лицензия

Лицензия

Категории

Категории

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

Группа

com.github.translocathor
Идентификатор

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

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

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

1.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Enumeration Generator Maven Plugin
A maven plugin that generates Java enums from properties files
Ссылка на сайт

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

http://maven.apache.org
Система контроля версий

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

https://github.com/translocathor/enumeration-generator

Скачать enumeration-generator-maven-plugin

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

<plugin>
    <groupId>com.github.translocathor</groupId>
    <artifactId>enumeration-generator-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.5.0
org.codehaus.plexus : plexus-utils jar 3.0.24
org.freemarker : freemarker jar 2.3.26-incubating
commons-io : commons-io jar 2.5

provided (1)

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

test (1)

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

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

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

License Build Code Climate

Enumeration Generator

Maven plugin to generate Java enumerations from properties files using Apache FreeMarker.

Getting Started

These instructions show a simple example on how to install and configure the plugin. See the Wiki for more configuration details.

Prerequisites

Since this is a Maven plugin, you need a Maven project. You also need to have an exising properties file from where the plugin can extract the keys.

Installing

Add the dependency

Add the enumeration-generator-maven-plugin as dependency to your dependencies section in your pom.xml.

...
<dependencies>
  ...
    <dependency>
        <groupId>com.github.translocathor</groupId>
        <artifactId>enumeration-generator-maven-plugin</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>

Add the plugin

Add the enumeration-generator-maven-plugin to the plugin section in your pom.xml.

...
<plugins>
  ..
  <plugin>
    <groupId>com.github.translocathor</groupId>
    <artifactId>enumeration-generator-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
      <execution>
        <id>generate-string-enum</id>
        <goals>
            <goal>generate-enumeration</goal>
        </goals>
        <configuration>
          <!--
              Package name that is used for the package
              declaration in the generated enum.
          -->
          <packageName>com.github.translocathor.egen.sample</packageName>
          <!--
              The name of the enum in the generated Java file.
          -->
          <enumName>StringKeys</enumName>
          <!--
              The properties file whose keys are used to
              derivate the enum constants.
          -->
          <propertiesFile>src/main/resources/bundles/de_DE_Strings.properties</propertiesFile>
          <!--
              The output file into which the generated Java
              file is written. If the specified output folder
              does not exist it will be created. If the file
              already exists it will be overwritten.
          -->
          <outputFile>src/main/java/com/github/translocathor/egen/sample/StringKeys.java</outputFile>
        </configuration>
      </execution>
    </executions>
  </plugin>
<plugins>
...

Execute

The plugin runs in the generate-sources phase by default and thus will be executed during the build automatically. If everything is configured correctly, the Java enum should be generated in the file you specified in the outputFile parameter.

License

Copyright 2017 Adrian Bingener

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

Версия
1.0