# Compile Graylog Sample Plugin

**URL:** <https://community.graylog.org/t/compile-graylog-sample-plugin/1752>\
**Category:** Development\
**Created:** [July 17, 2017, 2:04pm UTC](https://community.graylog.org/t/compile-graylog-sample-plugin/1752 "2017-07-17T14:04:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbrocker](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/pbrocker/32/889_2.png) [@pbrocker](https://community.graylog.org/u/pbrocker)\
**Post date:** [July 17, 2017, 2:04pm UTC](https://community.graylog.org/t/compile-graylog-sample-plugin/1752/1 "2017-07-17T14:04:38Z")

</div>

After using graylog-cli to successfully standup a graylog server (2.3.0) via Intellij. I downloaded the sample plugin code from github. ([https://github.com/Graylog2/graylog-plugin-sample](https://github.com/Graylog2/graylog-plugin-sample))

Following the readme documentation when I try to compile the plugin via command line. I get the following error.  
`Could not find artifact org.graylog2:graylog2-plugin:jar:2.0.0-SNAPSHOT`

When I load the plugin into Intellij the following dependencies are missing in the pom.xml  
`<artifactId>graylog2-plugin</artifactId> <version>${graylog2.version}</version>`

I have the plugin and the graylog server both in the same root directory.  
`graylog-project-repos/graylog2-server graylog-project-repos/graylog-plugin-sample`

How do I resolve this dependency issue!? It does not seem that the sample plugin code comes with graylog2-plugin code.

TLDR;  
Issue is that the sample plugin code cannot find the grayloy2-plugin dependency.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [July 17, 2017, 2:56pm UTC](https://community.graylog.org/t/compile-graylog-sample-plugin/1752/2 "2017-07-17T14:56:00Z")

</div>

The sample plugin is pretty much out of date and doesn’t work with Graylog 2.2.x or Graylog 2.3.x in that state.

Better take a look at a _real_ plugin such as [https://github.com/Graylog2/graylog-plugin-map-widget](https://github.com/Graylog2/graylog-plugin-map-widget)

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [July 17, 2017, 3:11pm UTC](https://community.graylog.org/t/compile-graylog-sample-plugin/1752/3 "2017-07-17T15:11:57Z")

</div>

I’ve created 2 issues for the sample plugin, so we don’t forget to fix that:

> <https://github.com/Graylog2/graylog-plugin-sample/issues/2>
>
> As a user new to Graylog plugin development, I would expect the official sample plugin (referenced in the documentation) to work...

  

> <https://github.com/Graylog2/graylog-plugin-sample/issues/3>
>
> The code of the sample plugin, especially the Maven POM and the package.json file, are out of date and don't reflect...

---

<div class="post-metadata">

**Author:** ![pbrocker](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/pbrocker/32/889_2.png) [@pbrocker](https://community.graylog.org/u/pbrocker)\
**Post date:** [July 17, 2017, 7:40pm UTC](https://community.graylog.org/t/compile-graylog-sample-plugin/1752/4 "2017-07-17T19:40:58Z")

</div>

Thanks, is there any suggestions you have on learning how to create a plugin besides looking at the map-widget or any of the ones in the graylog-project. I know that the scripts that used to be include to bootstrap plugins and setup all the components have been deprecated for graylog 2.0.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [July 18, 2017, 7:39am UTC](https://community.graylog.org/t/compile-graylog-sample-plugin/1752/5 "2017-07-18T07:39:40Z")

</div>

No, just stick to the existing (real-world) plugins on GitHub.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [August 1, 2017, 7:39am UTC](https://community.graylog.org/t/compile-graylog-sample-plugin/1752/6 "2017-08-01T07:39:55Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
