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"?> <?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">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent>
<modelVersion>4.0.0</modelVersion> <groupId>com.olexyn</groupId>
<artifactId>zeeroot</artifactId>
<groupId>com.olexyn.misp.helper</groupId> <version>17.0.1</version>
<artifactId>helper</artifactId> </parent>
<version>0.1</version> <groupId>com.olexyn.misp</groupId>
<artifactId>helper</artifactId>
<name>helper</name> <version>0.1</version>
<name>helper</name>
<properties> <dependencyManagement>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <dependencies>
<maven.compiler.source>11</maven.compiler.source> <dependency>
<maven.compiler.target>11</maven.compiler.target> <groupId>com.olexyn</groupId>
</properties> <artifactId>zeebom</artifactId>
<version>1.1.1</version>
<dependencies> <type>pom</type>
<dependency> <scope>import</scope>
<groupId>junit</groupId> </dependency>
<artifactId>junit</artifactId> </dependencies>
<version>3.8.1</version> </dependencyManagement>
</dependency> <dependencies>
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>20190722</version> </dependency>
</dependency> <dependency>
</dependencies> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<build> </dependencies>
<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> </project>

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

Loading…
Cancel
Save