Skip to content
This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Commit 3be3ea7

Browse files
committed
Switch to graylog-plugin.properties and use graylog plugin parent
1 parent f2472c5 commit 3be3ea7

File tree

3 files changed

+52
-13
lines changed

3 files changed

+52
-13
lines changed

pom.xml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
<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">
33
<modelVersion>4.0.0</modelVersion>
44
<prerequisites>
5-
<maven>3.0</maven>
5+
<maven>3.1</maven>
66
</prerequisites>
77

8-
<groupId>org.graylog.plugins</groupId>
8+
<parent>
9+
<groupId>org.graylog.plugins</groupId>
10+
<artifactId>graylog-plugin-parent</artifactId>
11+
<version>2.3.0-rc.2-SNAPSHOT</version>
12+
<relativePath>../graylog2-server/graylog-plugin-parent</relativePath>
13+
</parent>
14+
915
<artifactId>graylog-plugin-netflow</artifactId>
1016
<version>0.1.2-SNAPSHOT</version>
1117
<packaging>jar</packaging>
@@ -26,29 +32,48 @@
2632
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2733
<maven.compiler.source>1.8</maven.compiler.source>
2834
<maven.compiler.target>1.8</maven.compiler.target>
35+
<maven.source.skip>true</maven.source.skip>
36+
<maven.javadoc.skip>true</maven.javadoc.skip>
2937
<maven.install.skip>true</maven.install.skip>
3038
<maven.deploy.skip>true</maven.deploy.skip>
3139
<maven.site.skip>true</maven.site.skip>
32-
<graylog2.version>2.0.0</graylog2.version>
33-
<graylog2.plugin-dir>/usr/share/graylog-server/plugin</graylog2.plugin-dir>
40+
41+
<graylog.version>2.3.0-rc.2-SNAPSHOT</graylog.version>
42+
<graylog.plugin-dir>/usr/share/graylog-server/plugin</graylog.plugin-dir>
3443
</properties>
3544

3645
<dependencies>
3746
<dependency>
3847
<groupId>org.graylog2</groupId>
3948
<artifactId>graylog2-server</artifactId>
40-
<version>${graylog2.version}</version>
49+
<version>${graylog.version}</version>
50+
<scope>provided</scope>
51+
</dependency>
52+
<dependency>
53+
<groupId>com.google.auto.value</groupId>
54+
<artifactId>auto-value</artifactId>
55+
<version>${auto-value.version}</version>
4156
<scope>provided</scope>
4257
</dependency>
58+
4359
<dependency>
4460
<groupId>junit</groupId>
4561
<artifactId>junit</artifactId>
46-
<version>4.12</version>
62+
<version>${junit.version}</version>
4763
<scope>test</scope>
4864
</dependency>
4965
</dependencies>
5066

5167
<build>
68+
<resources>
69+
<resource>
70+
<directory>build</directory>
71+
</resource>
72+
<resource>
73+
<directory>src/main/resources</directory>
74+
<filtering>true</filtering>
75+
</resource>
76+
</resources>
5277
<plugins>
5378
<plugin>
5479
<groupId>org.apache.maven.plugins</groupId>
@@ -75,7 +100,7 @@
75100
<plugin>
76101
<groupId>com.mycila</groupId>
77102
<artifactId>license-maven-plugin</artifactId>
78-
<version>2.11</version>
103+
<version>${license-maven.version}</version>
79104
<configuration>
80105
<header>src/main/resources/templates/APACHE-2.txt</header>
81106
<properties>
@@ -117,7 +142,7 @@
117142
<plugin>
118143
<artifactId>jdeb</artifactId>
119144
<groupId>org.vafer</groupId>
120-
<version>1.5</version>
145+
<version>${jdeb.version}</version>
121146
<configuration>
122147
<deb>${project.build.directory}/${project.artifactId}-${project.version}.deb</deb>
123148
<dataSet>
@@ -126,7 +151,7 @@
126151
<type>file</type>
127152
<mapper>
128153
<type>perm</type>
129-
<prefix>${graylog2.plugin-dir}</prefix>
154+
<prefix>${graylog.plugin-dir}</prefix>
130155
<filemode>644</filemode>
131156
<user>root</user>
132157
<group>root</group>
@@ -139,7 +164,7 @@
139164
<plugin>
140165
<groupId>org.codehaus.mojo</groupId>
141166
<artifactId>rpm-maven-plugin</artifactId>
142-
<version>2.1.5</version>
167+
<version>${rpm-maven.version}</version>
143168
<configuration>
144169
<group>Application/Internet</group>
145170
<prefixes>
@@ -155,7 +180,7 @@
155180
<defaultGroupname>root</defaultGroupname>
156181
<mappings>
157182
<mapping>
158-
<directory>${graylog2.plugin-dir}</directory>
183+
<directory>${graylog.plugin-dir}</directory>
159184
<sources>
160185
<source>
161186
<location>${project.build.directory}/</location>

src/main/java/org/graylog/plugins/netflow/NetFlowPluginMetaData.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import java.util.Set;
2626

2727
public class NetFlowPluginMetaData implements PluginMetaData {
28+
private static final String PLUGIN_PROPERTIES = "org.graylog.plugins.graylog-plugin-netflow/graylog-plugin.properties";
29+
2830
@Override
2931
public String getUniqueId() {
3032
return "org.graylog.plugins.netflow.NetFlowPlugin";
@@ -47,7 +49,7 @@ public URI getURL() {
4749

4850
@Override
4951
public Version getVersion() {
50-
return new Version(0, 1, 0);
52+
return Version.fromPluginProperties(this.getClass(), PLUGIN_PROPERTIES, "version", Version.from(0, 0, 0, "unknown"));
5153
}
5254

5355
@Override
@@ -57,7 +59,7 @@ public String getDescription() {
5759

5860
@Override
5961
public Version getRequiredVersion() {
60-
return new Version(2, 0, 0);
62+
return Version.fromPluginProperties(this.getClass(), PLUGIN_PROPERTIES, "graylog.version", Version.CURRENT_CLASSPATH);
6163
}
6264

6365
@Override
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# The plugin version
2+
version=${project.version}
3+
4+
# The required Graylog server version
5+
graylog.version=${graylog.version}
6+
7+
# When set to true (the default) the plugin gets a separate class loader
8+
# when loading the plugin. When set to false, the plugin shares a class loader
9+
# with other plugins that have isolated=false.
10+
#
11+
# Do not disable this unless this plugin depends on another plugin!
12+
isolated=true

0 commit comments

Comments
 (0)