htmltemplate-maven-plugin

merge html fragment files into a single javascript template file used by angularjs client

Лицензия

Лицензия

Категории

Категории

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

Группа

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

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

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

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

0.1.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

htmltemplate-maven-plugin
merge html fragment files into a single javascript template file used by angularjs client
Ссылка на сайт

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

https://github.com/jasonzhang2022/htmltemplate-maven-plugin
Организация-разработчик

Организация-разработчик

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

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

https://github.com/jasonzhang2022/htmltemplate-maven-plugin

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

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

<plugin>
    <groupId>com.flexdms</groupId>
    <artifactId>htmltemplate-maven-plugin</artifactId>
    <version>0.1.0</version>
</plugin>

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.1.1
org.sonatype.plexus : plexus-build-api jar 0.0.7
org.codehaus.plexus : plexus-utils jar 3.0.8
commons-io : commons-io jar 2.4
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 2.0

provided (1)

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

test (4)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-compat jar 3.0.5
junit : junit jar 4.8.2
org.apache.maven.plugins : maven-plugin-plugin jar 3.2
org.apache.maven : maven-core jar 3.1.1

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

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

Table of Contents

Description

maven plugin to wrap html fragments into a javascript template used by angular js client

Introduction

You often have many small html files if angular js is used. Minimization exists for js/css. We also need such tool for htmls. This is particular useful if your html templates are used in UI library. One such example is UI Bootstrap. For exmaple, bootstrap UI has many small fragments as template. The final distribution is a single javascript file with all these htmls. This plugin consolidates html files into angular js template. It is built into maven compile phase.

Usage

Add this fragement to your pom

<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupid>
				<artifactId>maven-compiler-plugin</artifactid>
			</plugin>
			<plugin>
				<groupId>com.flexdms</groupid>
				<artifactId>htmltemplate-maven-plugin</artifactid>
				<version>1.0.2-SNAPSHOT</version>
				<configuration>
					<srcDirectory>src/main/webapp/fragments</srcdirectory>
					<finalFile>src/main/webapp/js/prop.js</finalfile>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>merge</goal>
						</goals>
						<phase>compile</phase>
					</execution>
				
				</executions>
			
			</plugin>
		</plugins>
</build>

Configuration

Three parameters are available.

  1. srcDirectory: source directory. File are searched recursively. All Files found are processed.
  2. finalFile: where to output Javascript file.
  3. templateFile: optional. If omitted, internal template is used.
  4. fileHeader: header string in the final file.
  5. fileFooter: footer string in the final file
  6. generateModule: whether to generate module statement.
  7. process: whether to escape html to make it appear as valid json string. Default true. If false, text is copied without ang modification.

Example

Please run mvn test to see an example. Test set up is under src/test/resources/unit directory. Final file is writtern to target/final.js or target/final2.js

License

apache 2

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

Версия
0.1.0