Twirl Maven Plugin (Parent)

Maven plugin for compiling Twirl templates.

Лицензия

Лицензия

Группа

Группа

com.jakewharton.twirl
Идентификатор

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

twirl-parent
Последняя версия

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

1.2.0
Дата

Дата

Тип

Тип

pom
Описание

Описание

Twirl Maven Plugin (Parent)
Maven plugin for compiling Twirl templates.
Система контроля версий

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

https://github.com/JakeWharton/twirl-maven-plugin

Скачать twirl-parent

Имя Файла Размер
twirl-parent-1.2.0.pom 4 KB
Обзор

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

<!-- https://jarcasting.com/artifacts/com.jakewharton.twirl/twirl-parent/ -->
<dependency>
    <groupId>com.jakewharton.twirl</groupId>
    <artifactId>twirl-parent</artifactId>
    <version>1.2.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.jakewharton.twirl/twirl-parent/
implementation 'com.jakewharton.twirl:twirl-parent:1.2.0'
// https://jarcasting.com/artifacts/com.jakewharton.twirl/twirl-parent/
implementation ("com.jakewharton.twirl:twirl-parent:1.2.0")
'com.jakewharton.twirl:twirl-parent:pom:1.2.0'
<dependency org="com.jakewharton.twirl" name="twirl-parent" rev="1.2.0">
  <artifact name="twirl-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.jakewharton.twirl', module='twirl-parent', version='1.2.0')
)
libraryDependencies += "com.jakewharton.twirl" % "twirl-parent" % "1.2.0"
[com.jakewharton.twirl/twirl-parent "1.2.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

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

  • twirl-maven-plugin
  • sample

Twirl Maven Plugin

A Maven plugin which compiles Twirl templates into Scala source files.

Twirl lets you write type-safe, compiled templates in Scala:

// Hello.scala.html
@(name: String)
<h1>Hello, @name!</h1>

which you then render in code:

html.Hello.render("Jake")

to yield the final result:

<h1>Hello, Jake!</h1>

Usage

Add the plugin in your pom.xml:

<plugin>
  <groupId>com.jakewharton.twirl</groupId>
  <artifactId>twirl-maven-plugin</artifactId>
  <version>1.2.0</version>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
  </executions>
</plugin>

and specify a dependency on the Twirl API:

<dependency>
  <groupId>com.typesafe.play</groupId>
  <artifactId>twirl-api_2.12</artifactId>
  <version>1.4.1</version>
</dependency>

By default the plugin looks for templates in src/main/twirl/ and compiles to target/generated-sources/twirl/. The output folder is automatically added as a source root on the project.

The generated code is a Scala source file for each template which still need to be compiled using something like the scala-maven-plugin.

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright 2014 Jake Wharton

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.2.0
1.1.0
1.0.5
1.0.4
1.0.3