Char Sniffer

Maven plugin to check char codes of text files

Лицензия

Лицензия

Категории

Категории

ORM Данные
Группа

Группа

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

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

char-sniffer
Последняя версия

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

1.0.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Char Sniffer
Maven plugin to check char codes of text files
Ссылка на сайт

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

https://github.com/raydac/char-sniffer
Организация-разработчик

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

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

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

https://github.com/raydac/char-sniffer

Скачать char-sniffer

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

<plugin>
    <groupId>com.igormaznitsa</groupId>
    <artifactId>char-sniffer</artifactId>
    <version>1.0.0</version>
</plugin>

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 2.0
commons-io : commons-io jar 2.5
commons-lang : commons-lang jar 2.6
org.codehaus.plexus : plexus-utils jar 3.0.8
com.igormaznitsa : meta-annotations jar 1.1.2
com.igormaznitsa : meta-utils jar 1.1.2

provided (1)

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

test (1)

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

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

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

License Apache 2.0 Java 6.0+ Maven central Maven 3.0.3+ PayPal donation Yandex.Money donation

Char Sniffer

A Small easy Maven plugin to check char codes in text files.

How to use?

For instance to restrict char codes (0-255) in text file License.txt situated in the root project folder, you can use such configuration

<plugin>
  <groupId>com.igormaznitsa</groupId>
  <artifactId>char-sniffer</artifactId>
  <version>1.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>sniff</goal>
      </goals>
      <configuration>
        <files>
          <file>${basedir}/License.txt</file>
        </files>
        <failForEmptyFile>true</failForEmptyFile>
        <minCharCode>0</minCharCode>
        <maxCharCode>255</maxCharCode>
      </configuration>
    </execution>
  </executions>
</plugin>

Also it is possible to define chars which will be only allowed in text files

<plugin>
  <groupId>com.igormaznitsa</groupId>
  <artifactId>char-sniffer</artifactId>
  <version>1.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>sniff</goal>
      </goals>
      <configuration>
         <files>
            <file>${basedir}/License.txt</file>
         </files>
         <abc>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ,.'":;/@[]()-=*%0123456789Ü</abc>
      </configuration>
    </execution>
  </executions>
</plugin>

It is possible to disable some chars in text files. For instance below described how to disable © and ™ in text files.

<plugin>
  <groupId>com.igormaznitsa</groupId>
  <artifactId>char-sniffer</artifactId>
  <version>1.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>sniff</goal>
      </goals>
      <configuration>
         <files>
            <file>${basedir}/License.txt</file>
         </files>
         <noAbc>&#8482;&#9400;</noAbc>
      </configuration>
    </execution>
  </executions>
</plugin>

To be sure that UTF-8 codes of text files are ok, it is possible to use special flag validateUtf8, it will check that all UTF-8 chars have normal codes and there is not any broken char.

<plugin>
  <groupId>com.igormaznitsa</groupId>
  <artifactId>char-sniffer</artifactId>
  <version>1.0.0</version>
  <executions>
    <execution>
      <goals>
        <goal>sniff</goal>
      </goals>
      <configuration>
         <files>
            <file>${basedir}/License.txt</file>
         </files>
         <validateUtf8>true</validateUtf8>
      </configuration>
    </execution>
  </executions>
</plugin>

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

Версия
1.0.0