Maven Central Repository

yauaa

Used in 13 components

Overview

A parsing and analyzing library to get information from a useragent string.

Snippets

<dependency>
    <groupId>nl.basjes.parse.useragent</groupId>
    <artifactId>yauaa</artifactId>
    <version>7.16.0</version>
</dependency>

Maven POM File

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <parent>
    <artifactId>yauaa-parent</artifactId>
    <groupId>nl.basjes.parse.useragent</groupId>
    <version>7.16.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>yauaa</artifactId>
  <name>Yauaa : Analyzer</name>
  <description>A parsing and analyzing library to get information from a useragent string.</description>
  <url>https://yauaa.basjes.nl</url>
  <developers>
    <developer>
      <name>Niels Basjes</name>
      <email>niels@basjes.nl</email>
      <roles>
        <role>Architect</role>
        <role>Developer</role>
      </roles>
      <timezone>Europe/Amsterdam</timezone>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:https://github.com/nielsbasjes/yauaa.git</connection>
    <developerConnection>scm:git:file:///${project.basedir}</developerConnection>
    <tag>v7.16.0</tag>
    <url>https://github.com/nielsbasjes/yauaa</url>
  </scm>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-toolchains-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>toolchain</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <toolchains>
            <jdk>
              <version>17</version>
            </jdk>
          </toolchains>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>UserAgents/*.sh</exclude>
            <exclude>UserAgents/**/*.sh</exclude>
            <exclude>UserAgents/**/*.csv</exclude>
            <exclude>UserAgents/**/*.txt</exclude>
            <exclude>UserAgents/**/*.tab</exclude>
            <exclude>UserAgents/**/*.md</exclude>
          </excludes>
          <archive>
            <manifestEntries>
              <Specification-Title>Yauaa: Yet Another UserAgent Analyzer</Specification-Title>
              <Specification-Version>${project.version}</Specification-Version>
              <Specification-Vendor>Niels Basjes</Specification-Vendor>
              <Implementation-Title>Yauaa: Yet Another UserAgent Analyzer</Implementation-Title>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Implementation-Vendor>Niels Basjes</Implementation-Vendor>
              <Implementation-Vendor-Id>nl.basjes</Implementation-Vendor-Id>
              <Automatic-Module-Name>${Automatic-Module-Name}</Automatic-Module-Name>
              <url>${project.url}</url>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>inject-problematic-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>org.antlr:antlr4-runtime</include>
                  <include>org.yaml:snakeyaml</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <minimizeJar>true</minimizeJar>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <useDependencyReducedPomInJar>true</useDependencyReducedPomInJar>
          <filters>
            <filter>
              <artifact>org.antlr:antlr4-runtime</artifact>
              <excludes>
                <exclude>META-INF/services/**</exclude>
                <exclude>META-INF/MANIFEST.MF</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>org.yaml:snakeyaml</artifact>
              <excludes>
                <exclude>META-INF/services/**</exclude>
                <exclude>META-INF/MANIFEST.MF</exclude>
                <exclude>META-INF/versions/**</exclude>
              </excludes>
            </filter>
          </filters>
          <relocations>
            <relocation>
              <pattern>org.antlr</pattern>
              <shadedPattern>nl.basjes.shaded.org.antlr</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.yaml.snakeyaml</pattern>
              <shadedPattern>nl.basjes.shaded.org.yaml.snakeyaml</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.basedir}</directory>
              <includes>
                <include>dependency-reduced-pom.xml</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.alexecollins.maven.plugin</groupId>
        <artifactId>script-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>Verify jar contents to ensure the shading of dependencies went right</id>
            <phase>verify</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <language>beanshell</language>
              <script>import java.io.*;
                import java.util.jar.*;
                import java.util.Arrays;
                import org.codehaus.plexus.util.*;

                System.out.println("Verifying if the shading went correctly");

                String[] libraryWanted = {
                  "nl/basjes/parse/useragent/utils/YauaaVersion.class",
                  "nl/basjes/shaded/org/antlr/v4/runtime/Parser.class",
                };

                String[] libraryUnwanted = {
                  "org/antlr/v4/runtime/Parser.class",
                  "org/springframework/core/io/support/PathMatchingResourcePatternResolver.class",
                  "org/slf4j/LoggerFactory.class",
                };

                JarFile libraryJarFile = new JarFile( new File( "${project.basedir}/target", "yauaa-${project.version}.jar" ) );

                for ( String path : libraryWanted ) {
                  if ( libraryJarFile.getEntry( path ) == null ) {
                    throw new IllegalStateException( "Library: wanted path is missing: " + path );
                  }
                }

                for ( String path : libraryUnwanted ) {
                  if ( libraryJarFile.getEntry( path ) != null ) {
                    throw new IllegalStateException( "Library: unwanted path is present: " + path );
                  }
                }</script>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache-extras.beanshell</groupId>
            <artifactId>bsh</artifactId>
            <version>2.0b6</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>Generate Matchers and Lookups</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>./regen-all.sh</executable>
            </configuration>
          </execution>
          <execution>
            <id>Generate list of testcases</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>./getTestCases.sh</executable>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>${antlr.version}</version>
        <executions>
          <execution>
            <id>antlr</id>
            <goals>
              <goal>antlr4</goal>
            </goals>
            <configuration>
              <visitor>true</visitor>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${spotbugs-maven-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>nl/basjes/parse/useragent/Version.class</exclude>
            <exclude>nl/basjes/parse/useragent/PackagedRules.class</exclude>
            <exclude>nl/basjes/parse/useragent/parser/*.class</exclude>
            <exclude>nl/basjes/parse/useragent/debug/*.class</exclude>
            <exclude>nl/basjes/parse/useragent/utils/publicsuffixlist/**/*.class</exclude>
            <exclude>nl/basjes/parse/useragent/utils/springframework/**/*.class</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <fileset />
                <pathconvert>
                  <map />
                </pathconvert>
                <echo>${my-file-list}</echo>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <version>1.5.3</version>
        <executions>
          <execution>
            <id>Generate Version YAML</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <file>${basedir}/src/main/code-gen/version/Version.yaml.template</file>
              <regex>false</regex>
              <outputFile>${basedir}/target/classes/UserAgents/__Version__.yaml</outputFile>
            </configuration>
          </execution>
          <execution>
            <id>Generate Version Java</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <file>${basedir}/src/main/code-gen/version/Version.java.template</file>
              <regex>false</regex>
              <outputFile>${basedir}/target/generated-sources/java/nl/basjes/parse/useragent/Version.java</outputFile>
            </configuration>
          </execution>
          <execution>
            <id>Generate Yaml List Java</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <file>${basedir}/src/main/code-gen/UserAgents/PackagedRules.java.template</file>
              <regex>false</regex>
              <outputFile>${basedir}/target/generated-sources/java/nl/basjes/parse/useragent/PackagedRules.java</outputFile>
            </configuration>
          </execution>
          <execution>
            <id>Generate Preheat Java</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <file>${basedir}/src/main/code-gen/UserAgents/PreHeatCases.java.template</file>
              <regex>false</regex>
              <outputFile>${basedir}/target/generated-sources/java/nl/basjes/parse/useragent/PreHeatCases.java</outputFile>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <replacements>
            <replacement>
              <token>@git.commit.id@</token>
              <value>${git.commit.id}</value>
            </replacement>
            <replacement>
              <token>@git.commit.id.describe-short@</token>
              <value>${git.commit.id.describe-short}</value>
            </replacement>
            <replacement>
              <token>@project.build.outputTimestamp@</token>
              <value>${project.build.outputTimestamp}</value>
            </replacement>
            <replacement>
              <token>@project.version@</token>
              <value>${project.version}</value>
            </replacement>
            <replacement>
              <token>@version.copyright@</token>
              <value>${version.copyright}</value>
            </replacement>
            <replacement>
              <token>@version.license@</token>
              <value>${version.license}</value>
            </replacement>
            <replacement>
              <token>@version.url@</token>
              <value>${version.url}</value>
            </replacement>
            <replacement>
              <token>@target.java.version@</token>
              <value>${target.java.version}</value>
            </replacement>
            <replacement>
              <token>###file-list###</token>
              <valueFile>${basedir}/target/temp-yaml-list.txt</valueFile>
            </replacement>
            <replacement>
              <token>###agents-list###</token>
              <valueFile>${basedir}/target/temp-agents-list.txt</valueFile>
            </replacement>
          </replacements>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/java/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <failIfNoProjects>true</failIfNoProjects>
          <streamLogsOnFailures>true</streamLogsOnFailures>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <setupIncludes>
            <setupInclude>setup/*/pom.xml</setupInclude>
          </setupIncludes>
          <pomIncludes>
            <pomInclude>JavaPlain/*/pom.xml</pomInclude>
            <pomInclude>JavaJPMS/*/pom.xml</pomInclude>
            <pomInclude>Logging/*/pom.xml</pomInclude>
            <pomInclude>Serialization/*/pom.xml</pomInclude>
            <pomInclude>Examples/*/pom.xml</pomInclude>
          </pomIncludes>
          <postBuildHookScript>verify</postBuildHookScript>
          <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
          <settingsFile>./src/it/settings.xml</settingsFile>
          <goals>
            <goal>clean</goal>
            <goal>test</goal>
          </goals>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-quality</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <banDuplicateClasses>
                  <scopes>
                    <scope>compile</scope>
                    <scope>runtime</scope>
                    <scope>provided</scope>
                  </scopes>
                  <findAllDuplicates>true</findAllDuplicates>
                  <ignoreWhenIdentical>true</ignoreWhenIdentical>
                </banDuplicateClasses>
                <enforceBytecodeVersion>
                  <maxJdkVersion>8</maxJdkVersion>
                  <excludes>
                    <exclude>com.github.ben-manes.caffeine:caffeine</exclude>
                  </excludes>
                </enforceBytecodeVersion>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>extra-enforcer-rules</artifactId>
            <version>1.6.1</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>1.11.4</version>
        <configuration>
          <threads>4</threads>
          <reportsDirectory>${project.basedir}/pitest/pit-reports</reportsDirectory>
          <historyInputFile>${project.basedir}/pitest/yauaa_pitest_history.bin</historyInputFile>
          <historyOutputFile>${project.basedir}/pitest/yauaa_pitest_history.bin</historyOutputFile>
          <timestampedReports>true</timestampedReports>
          <excludedMethods>
            <excludedMethod>toString</excludedMethod>
          </excludedMethods>
          <excludedClasses>
            <excludedClass>nl.basjes.parse.useragent.Version</excludedClass>
            <excludedGroup>nl.basjes.parse.useragent.parser.*</excludedGroup>
            <excludedGroup>nl.basjes.parse.useragent.debug.*</excludedGroup>
          </excludedClasses>
          <avoidCallsTo>
            <avoidCallsTo>java.util.logging</avoidCallsTo>
            <avoidCallsTo>org.apache.log4j</avoidCallsTo>
            <avoidCallsTo>org.slf4j</avoidCallsTo>
            <avoidCallsTo>org.apache.commons.logging</avoidCallsTo>
          </avoidCallsTo>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>prepareRelease</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <executions>
              <execution>
                <id>Remove mozilla-public-suffix-list.txt to force download.</id>
                <phase>clean</phase>
                <goals>
                  <goal>clean</goal>
                </goals>
                <configuration>
                  <filesets>
                    <fileset>
                      <directory>${project.basedir}/src/main/resources/</directory>
                      <includes>
                        <include>mozilla-public-suffix-list.txt</include>
                      </includes>
                    </fileset>
                  </filesets>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.googlecode.maven-download-plugin</groupId>
            <artifactId>download-maven-plugin</artifactId>
            <version>1.6.8</version>
            <executions>
              <execution>
                <id>download-public-suffix-list</id>
                <phase>initialize</phase>
                <goals>
                  <goal>wget</goal>
                </goals>
                <configuration>
                  <skipCache>true</skipCache>
                  <url>https://publicsuffix.org/list/public_suffix_list.dat</url>
                  <outputDirectory>${project.basedir}/src/main/resources/</outputDirectory>
                  <outputFileName>mozilla-public-suffix-list.txt</outputFileName>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-scm-plugin</artifactId>
            <executions>
              <execution>
                <id>persist-public-suffix-list</id>
                <phase>initialize</phase>
                <goals>
                  <goal>add</goal>
                </goals>
                <configuration>
                  <basedir>${project.basedir}</basedir>
                  <includes>src/main/resources/mozilla-public-suffix-list.txt</includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <version>1.10.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-lang3</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.12.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.github.ben-manes.caffeine</groupId>
      <artifactId>caffeine</artifactId>
      <version>3.1.5</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <version>4.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>nl.basjes.collections</groupId>
      <artifactId>prefixmap</artifactId>
      <version>2.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>kryo</artifactId>
          <groupId>com.esotericsoftware</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.26</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.20.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.esotericsoftware</groupId>
      <artifactId>kryo</artifactId>
      <version>5.4.0</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.9.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.9.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <version>2.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <Automatic-Module-Name>nl.basjes.parse.useragent</Automatic-Module-Name>
  </properties>
</project>