Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Recog Java

[![Travis (.org)](https://img.shields.io/travis/rapid7/recog-java.svg)](https://travis-ci.org/rapid7/recog-java) [![Maven Central](https://img.shields.io/maven-central/v/com.rapid7.recog/recog-java.svg)](https://search.maven.org/artifact/com.rapid7.recog/recog-java) [![Javadocs](https://www.javadoc.io/badge/com.rapid7.recog/recog-java.svg)](https://www.javadoc.io/doc/com.rapid7.recog/recog-java)
[![CI workflow](https://github.com/rapid7/recog-java/actions/workflows/ci.yml/badge.svg)](https://github.com/rapid7/recog-java/actions/workflows/ci.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.rapid7.recog/recog-java.svg)](https://search.maven.org/artifact/com.rapid7.recog/recog-java) [![Javadocs](https://www.javadoc.io/badge/com.rapid7.recog/recog-java.svg)](https://www.javadoc.io/doc/com.rapid7.recog/recog-java)

Java implementation of [Recog](https://github.com/rapid7/recog) that supports parsing and matching.

Expand Down Expand Up @@ -82,7 +82,7 @@ Missing features:

- Matching against multi-line input strings
- Matching against base64 encoded strings
- Command line tools like `recog_match` and `recog_verify`
- Command line tools like `recog_match`

## Development

Expand Down
202 changes: 91 additions & 111 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.rapid7.recog</groupId>
<artifactId>recog-java</artifactId>
<version>0.7.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>recog-java</name>
<url>https://www.rapid7.com</url>
<description>Java implementation of Recog that supports parsing and matching.</description>
<artifactId>recog-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
<packaging>pom</packaging>

<scm>
<connection>scm:git:git@github.com:rapid7/recog-java.git</connection>
Expand Down Expand Up @@ -45,11 +42,12 @@
</distributionManagement>

<properties>
<r7.recog.content.version>2.2.1</r7.recog.content.version>
<r7.recog.content.version>2.3.21</r7.recog.content.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- third party dependencies -->
<commons.cli.version>1.4</commons.cli.version>
<slf4j.version>1.7.25</slf4j.version>
<!-- test dependencies -->
<commons.io.version>2.6</commons.io.version>
Expand All @@ -59,69 +57,92 @@
<mockito.version>2.18.0</mockito.version>
</properties>

<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
<scope>test</scope>
</dependency>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.rapid7.recog</groupId>
<artifactId>recog-java</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.rapid7.recog</groupId>
<artifactId>recog-java</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>${commons.cli.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
Expand Down Expand Up @@ -153,7 +174,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<configLocation>${basedir}/google_checks.xml</configLocation>
<configLocation>${maven.multiModuleProjectDirectory}/google_checks.xml</configLocation>
<violationSeverity>warning</violationSeverity>
</configuration>
<executions>
Expand All @@ -164,7 +185,7 @@
<goal>check</goal>
</goals>
<configuration>
<configLocation>${basedir}/google_checks.xml</configLocation>
<configLocation>${maven.multiModuleProjectDirectory}/google_checks.xml</configLocation>
</configuration>
</execution>
</executions>
Expand All @@ -177,53 +198,6 @@
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>**/*Integration.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>recog-download</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<mkdir dir="${project.build.directory}/recog" />
<get src="http://production.cf.rubygems.org/gems/recog-${r7.recog.content.version}.gem" dest="${project.build.directory}/recog/recog-${r7.recog.content.version}.tar" usetimestamp="true" />
<untar src="${project.build.directory}/recog/recog-${r7.recog.content.version}.tar" dest="${project.build.directory}/recog" />
<untar compression="gzip" src="${project.build.directory}/recog/data.tar.gz" dest="${project.build.directory}/test-classes/com/rapid7/recog/fingerprints">
<patternset>
<include name="xml/*.xml" />
</patternset>
<mapper type="flatten" />
</untar>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -296,4 +270,10 @@
</build>
</profile>
</profiles>

<modules>
<module>recog</module>
<module>recog-verify</module>
</modules>

</project>
83 changes: 83 additions & 0 deletions recog-verify/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.rapid7.recog</groupId>
<artifactId>recog-verify</artifactId>
<packaging>jar</packaging>
<name>recog-verify</name>
<url>https://www.rapid7.com</url>
<description>Java implementation of Recog fingerprint verification tool.</description>

<parent>
<groupId>com.rapid7.recog</groupId>
<artifactId>recog-parent</artifactId>
<version>0.8.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>com.rapid7.recog</groupId>
<artifactId>recog-java</artifactId>
</dependency>

<dependency>
<groupId>com.rapid7.recog</groupId>
<artifactId>recog-java</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
</dependencies>

</project>
20 changes: 20 additions & 0 deletions recog-verify/src/main/java/com/rapid7/recog/verify/Color.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.rapid7.recog.verify;

// ANSI color escape codes
enum Color {
Reset(0),
Red(31),
Yellow(33),
Green(32),
White(15);

private final int code;

Color(int code) {
this.code = code;
}

public int getCode() {
return code;
}
}
Loading