clean / bump helper

master
io42630 1 year ago
parent f4a595f370
commit d4e2f95cf3

@ -0,0 +1,6 @@
### MISP Helper
#### Build
* do `mvn clean install` for local
* or `mvn deploy` for local nexus

@ -1,10 +0,0 @@
#!/bin/bash
version="0.1"
file="target/helper-${version}.jar"
groupId="com.olexyn.misp.helper"
artifactId="helper"
mvn package
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -DgeneratePom=true

@ -1,84 +1,34 @@
<?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.olexyn.misp.helper</groupId>
<artifactId>helper</artifactId>
<version>0.1</version>
<name>helper</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
</plugin>
</plugins>
</reporting>
<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>
<parent>
<groupId>com.olexyn</groupId>
<artifactId>zeeroot</artifactId>
<version>17.0.1</version>
</parent>
<groupId>com.olexyn.misp</groupId>
<artifactId>helper</artifactId>
<version>0.1</version>
<name>helper</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.olexyn</groupId>
<artifactId>zeebom</artifactId>
<version>1.1.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>

@ -1,5 +1,7 @@
package com.olexyn.misp.helper;
import lombok.Getter;
import lombok.Setter;
import org.json.JSONException;
import org.json.JSONObject;
@ -8,50 +10,28 @@ public class Ride {
private static long count = 0L;
final private Long id;
@Getter
private Long id;
@Getter
@Setter
private String request;
@Getter
@Setter
private String data;
public Ride() {
id = count++;
}
public Ride() { id = count++; }
public Ride(String jsonString) { this(new JSONObject(jsonString)); }
public Ride(JSONObject obj) {
long _id;
try { _id = obj.getLong("id"); } catch (JSONException e) { _id = count++; }
id = _id;
try { id = obj.getLong("id"); } catch (JSONException e) { id = count++; }
try { request = obj.getString("request"); } catch (JSONException e) { request = null; }
try { data = obj.getString("data"); } catch (JSONException e) { data = null; }
}
public void setRequest(String request) {
this.request = request;
}
public void setData(String data) {
this.data = data;
}
public String getRequest() {
return this.request;
}
public String getData() {
return this.data;
}
public Long getID() {
return this.id;
}
public String json() {
JSONObject obj = new JSONObject();
obj.put("id", id);

Loading…
Cancel
Save