io.github.guitaro:erb-templating-maven-plugin

ERB Templating Maven Plugin

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка GUI Взаимодействие с пользователем
Группа

Группа

io.github.guitaro
Идентификатор

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

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

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

1.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

io.github.guitaro:erb-templating-maven-plugin
ERB Templating Maven Plugin
Ссылка на сайт

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

https://github.com/guitaro/erb-templating-maven-plugin
Система контроля версий

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

https://github.com/guitaro/erb-templating-maven-plugin.git

Скачать erb-templating-maven-plugin

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

<plugin>
    <groupId>io.github.guitaro</groupId>
    <artifactId>erb-templating-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.2.5
org.jruby : jruby-complete jar 1.7.19
org.apache.maven : maven-project jar 3.0-alpha-2
org.apache.maven.shared : maven-filtering jar 1.3

provided (1)

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

test (1)

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

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

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

erb-templating-maven-plugin

Maven plugin which parse ERB file templates with YAML variables contexts.

Syntax

Let's take for example this context :

name: "world!"
var2:
    attribute: 123
shopping_list:
 - potatoes
 - tomatoes
 - eggs

Variables

<%# This is just a comment %>
Hello, <%= @name %>.
Today is <%= Time.now.strftime('%A') %>.

Structure controle

If/else

<%= if @var1 == "someText" %>
    I'm in if
<% else %>
    I'm in else
<% end %>

For

<% for @item in @shopping_list %>
  <%= @item %>
<% end %>

Foreach (array)

<%= if @array.each do |value| %>
    <%= @value %>
<% end %>

Foreach (map)

Iterate through key/value pair :

<%= if @map.each do |key, value| %>
    <%= @key %> => <%= @value %>
<% end %>

Iterate through keys :

<%= if @map.each_key do |key| %>
    <%= @key %> => <%= @map[@key] %>
<% end %>

Iterate through values :

<%= if @map.each_value do |value| %>
    <%= @value %>
<% end %>

How to use

Add maven plugin dependency :

<build>
    <plugins>
        <plugin>
            <groupId>io.levyndot</groupId>
            <artifactId>erb-templating-maven-plugin</artifactId>
            <version>1.0</version>
            ...
        </plugin>
    </plugins>
</build>

Configure execution :

<executions>
    <execution>
        <id>templating</id>
        <goals>
            <goal>run</goal>
        </goals>
        <configuration>
            <templates>
                <template>${project.basedir}/templates/**/*</template>
                <template>${project.basedir}/other_templates/template.txt.erb</template>
            </templates>
            <contexts>
                <context>${project.basedir}/contexts/**/*</context>
                <context>${project.basedir}/other_context/vars.yaml</context>
            </contexts>
            <targetDir>${project.build.directory}</targetDir>
            <removeExtension>true</removeExtension>
            <skip>false</skip>
        </configuration>
    </execution>
</executions>

Options :

name type Default Description
templates List empty list List of ERB templates files. Can be a wildcard on the end of path. Middle wildcards are not supported.
contexts List empty list List of YAML variables files. Can be a wildcard on the end of path. Middle wildcards are not supported.
targetDir String ${project.build.directory} Path to output files.
removeExtension Boolean false If true, so output file will be renamed without ".erb" extension.
skip Boolean false If true, the plugin will not be run.

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

Версия
1.0