# Compiling Graylog-server code for plugin development

**URL:** <https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960>\
**Category:** Development\
**Created:** [December 15, 2022, 4:54pm UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960 "2022-12-15T16:54:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofentselogger](https://avatars.discourse-cdn.com/v4/letter/o/97f17d/32.png) [@ofentselogger](https://community.graylog.org/u/ofentselogger)\
**Post date:** [December 15, 2022, 4:54pm UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/1 "2022-12-15T16:54:52Z")

</div>

I am interested in building my Graylog plugin without having to compile the whole graylog-server project (I am getting yarn build error).  
I prefer to compile the plugin only and deploy to production. Is there a possibility of running mvn package for the plugin like before?

The only difference to before is that instead of using an example plugin code, I bootstrapped from github.

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [December 15, 2022, 10:55pm UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/2 "2022-12-15T22:55:45Z")

</div>

Hello @ofentselogger

Are you refering to this in GitHub?

> **[GitHub - Graylog2/graylog-project: Packaging/development helper for Graylog](https://github.com/Graylog2/graylog-project)**
>
> Packaging/development helper for Graylog. Contribute to Graylog2/graylog-project development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![ofentselogger](https://avatars.discourse-cdn.com/v4/letter/o/97f17d/32.png) [@ofentselogger](https://community.graylog.org/u/ofentselogger)\
**Post date:** [December 16, 2022, 11:40am UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/3 "2022-12-16T11:40:00Z")

</div>

Hi @gsmith

Yes, that is what I refer to. I used it to checkout version 4.2 and I then followed the below to bootstrap my plugin before I then ran mvn compile & mvn package for the whole project. I followed the 4-x version which seems similar.

Either I just picked up an Out of Memory issue with my server. I need to add some RAM so I can get the compilation to terminate successfully. I will post an update as soon as I complete this.

[https://go2docs.graylog.org/5-0/what\_more\_can\_graylog\_do\_for\_me/plugins.html](https://go2docs.graylog.org/5-0/what_more_can_graylog_do_for_me/plugins.html)

---

<div class="post-metadata">

**Author:** ![ofentselogger](https://avatars.discourse-cdn.com/v4/letter/o/97f17d/32.png) [@ofentselogger](https://community.graylog.org/u/ofentselogger)\
**Post date:** [December 16, 2022, 5:53pm UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/4 "2022-12-16T17:53:08Z")

</div>

Wow, I somewhat underestimated the size of the compile. Finally I have something meaningful after resolving the memory issue.  
I have managed to do the initial mvn compile. I manage to compile everything but my plugin. It talks of an issue with the target version. Not sure if this relates to Java 17? But I run Graylog 4.2 on openjdk 1.8 \*. Below are the error logs.

> Blockquote  
> [INFO] — maven-compiler-plugin:3.7.0:compile (default-compile) @ graylog-plugin-smpp —  
> [INFO] Compiling 4 source files to /home/graylog/build/graylog-project-repos/graylog-plugin-smpp/target/classes  
> [INFO] ------------------------------------------------------------------------  
> [INFO] Reactor Summary:  
> [INFO]  
> [INFO] Graylog Parent POM … SUCCESS [0.034 s]  
> [INFO] Graylog Project Parent POM … SUCCESS [0.127 s]  
> [INFO] Graylog … SUCCESS [08:41 min]  
> [INFO] Graylog Plugin Parent POM … SUCCESS [0.004 s]  
> [INFO] Graylog Plugin with Web support Parent POM … SUCCESS [3.497 s]  
> [INFO] graylog-plugin-collector … SUCCESS [05:15 min]  
> [INFO] graylog-plugin-aws … SUCCESS [04:38 min]  
> [INFO] graylog-plugin-threatintel … SUCCESS [05:20 min]  
> [INFO] graylog-plugin-integrations … SUCCESS [05:07 min]  
> [INFO] graylog-project 4.2.14-SNAPSHOT … SUCCESS [0.015 s]  
> [INFO] runner … SUCCESS [0.523 s]  
> [INFO] graylog-storage-elasticsearch6 … SUCCESS [4.230 s]  
> [INFO] graylog-storage-elasticsearch7 … SUCCESS [3.838 s]  
> [INFO] full-backend-tests … SUCCESS [0.651 s]  
> [INFO] graylog-plugin-archetype … SUCCESS [0.161 s]  
> [INFO] Graylog Binary Distribution Tarball … SUCCESS [0.048 s]  
> [INFO] graylog-plugin-smpp 1.0.0-SNAPSHOT … FAILURE [02:44 min]  
> [INFO] ------------------------------------------------------------------------  
> [INFO] BUILD FAILURE  
> [INFO] ------------------------------------------------------------------------  
> [INFO] Total time: 32:01 min  
> [INFO] Finished at: 2022-12-16T17:30:43Z  
> [INFO] ------------------------------------------------------------------------  
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project graylog-plugin-smpp: Fatal error compiling: CompilerException: InvocationTargetException: invalid target release: 17 → [Help 1]  
> [ERROR]  
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.

> Blockquote

---

<div class="post-metadata">

**Author:** ![ofentselogger](https://avatars.discourse-cdn.com/v4/letter/o/97f17d/32.png) [@ofentselogger](https://community.graylog.org/u/ofentselogger)\
**Post date:** [December 16, 2022, 6:16pm UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/5 "2022-12-16T18:16:19Z")

</div>

> [@ofentselogger](#):
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile

The plugin was bootstrapped for Java 17. I modified the pom to 1.8. I now have a successful compile.

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [December 17, 2022, 2:11am UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/6 "2022-12-17T02:11:53Z")

</div>

Hey.,

> [@ofentselogger](#):
>
> I now have a successful compile.

Nice, can I ask what or how much resources do you have on that node? if the issues is resolved could you mark this as " resolved " for future searches.

---

<div class="post-metadata">

**Author:** ![ofentselogger](https://avatars.discourse-cdn.com/v4/letter/o/97f17d/32.png) [@ofentselogger](https://community.graylog.org/u/ofentselogger)\
**Post date:** [December 17, 2022, 7:16am UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/7 "2022-12-17T07:16:23Z")

</div>

Hi @gsmith  
Resources: I had about 2GB RAM with 2 vCPUs and a minimum of 25GB HDD. This was not sufficient. I also remembered that when I was building glibc earlier this year, I needed more than 2GB RAM.  
So to be safe I increased the RAM to 8GB.

I have now marked the issue as resolved. I am now left with basic programmatic issues (I copied and pasted an old plugin code to this new bootstrap) in order to make this new bootstrap work. It seems older plugin code doesnt run on Graylog 4.2.x hence I had to bootstrap (and made mistakes to learn from :))

Thanks.

---

<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:** [December 31, 2022, 7:17am UTC](https://community.graylog.org/t/compiling-graylog-server-code-for-plugin-development/26960/8 "2022-12-31T07:17:01Z")

</div>

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