<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Corey Moten</title>
    <description>The latest articles on Forem by Corey Moten (@mediocre_dev).</description>
    <link>https://forem.com/mediocre_dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F63163%2Ffa48b2bb-ba5f-4dfa-8193-9d9741117094.png</url>
      <title>Forem: Corey Moten</title>
      <link>https://forem.com/mediocre_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mediocre_dev"/>
    <language>en</language>
    <item>
      <title>Building a commercial plugin for the JetBrains plugin marketplace</title>
      <dc:creator>Corey Moten</dc:creator>
      <pubDate>Mon, 22 Jun 2020 14:09:12 +0000</pubDate>
      <link>https://forem.com/mediocre_dev/building-a-commercial-plugin-for-the-jetbrains-plugin-marketplace-kdo</link>
      <guid>https://forem.com/mediocre_dev/building-a-commercial-plugin-for-the-jetbrains-plugin-marketplace-kdo</guid>
      <description>&lt;p&gt;TLDR; I decided to write down some of the takeaways, pain points, lessons learned, etc. of building my first commercial plugin for the JetBrains plugin marketplace &lt;a href="https://plugins.jetbrains.com/plugin/14519-spellbook"&gt;&lt;strong&gt;Spellbook&lt;/strong&gt;&lt;/a&gt;. If you've built a cool plugin, or have a cool plugin idea for JetBrains IDEs and are looking for a good solution to monetize it KEEP READING...&lt;/p&gt;




&lt;p&gt;Ever since JetBrains announced a marketplace for third party plugin developers to sell their work I've been curious to try to build something and test the waters of the JetBrains marketplace solution. I'm pretty stoked to say that I have just recently completed development of my first commercial plugin, &lt;a href="https://plugins.jetbrains.com/plugin/14519-spellbook"&gt;&lt;strong&gt;Spellbook&lt;/strong&gt;&lt;/a&gt;, and released it via the JetBrains plugin marketplace! WOOT! WOOT! 🎉 🥳!&lt;/p&gt;

&lt;p&gt;As awesome as this milestone is for me, I must say it was not as easy as I had imagined it would be; not just to build the plugin, but also to go through the process of releasing the plugin in the marketplace. I figured I'd write some takeaways and lessons learned here, to solidify the process in my mind for the next plugin I plan to build, but also to provide some information to other devs out there who may be interested in building a plugin of their own!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Do you like Java and SWING? I hope so...&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JetBrains IDEs are desktop apps built with Java and the Swing GUI toolkit. As such, any extensions to the IDE UI are also developed using Java and Swing. It appears that Kotlin is now also supported for plugin development, but I didn't try to use Kotlin, so I'm not sure how deep the support goes.&lt;/p&gt;

&lt;p&gt;The Intellij IDE has some pretty awesome built in tools to get you going with development, including template projects, debugging tools, and IDE development instances for testing your plugin during development. I guess in theory you could use any text editor or IDE that supports Java for development, but IMO Intellij definitely provides the goods needed to quickly get going and sustain you during the development process.&lt;/p&gt;

&lt;p&gt;You'll need to use the Intellij APIs to do most of the UI work for your plugin. Many of the components provided in the APIs are very customized implementations of various Swing components. You probably could use only Swing UI widgets to build your plugin's UI, but to ensure consistent look and feel across JetBrains IDEs, its better to use the Intellij API components whenever you can. Extending them to add additional functionality is generally pretty trivial.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Buidling with Gradle and running an IDE instance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;There are two options for building your plugin in order to run it: DevKit or Gradle. Gradle is the more modern way to build plugins against JetBrains products and its use is recommended by JetBrains for new plugin projects. DevKit is the older tool used for building plugin projects and although it is outdated, it is still an option if you'd like to go that route. I chose Gradle because of JetBrains recommendation and because I'm more familiar with it. I also liked that I could manage my plugin's library dependencies alongside my plugin's build tasks.&lt;/p&gt;

&lt;p&gt;When you create a new plugin project using the template project starter in Intellij, a plugin.xml file and a build.gradle file are generated for you. The build.gradle file is generated with a bunch of tasks that you'll need for building the plugin and also for running the plugin in an IDE instance, and deploying the plugin to the plugin repository if required. The plugin.xml file is essentially your plugin's descriptor file. It contains, among other things, declarations for any actions your plugin will execute, services your plugin will provide, and tool windows your plugin will utilize. This is also where you will specify administrative details for your plugin, (i.e. vendor info, versioning info, etc.).&lt;/p&gt;

&lt;p&gt;You'll need to run your plugin at some point to see all the sweet features you've been building. Obviously, you'll need an IDE instance for your code to run against. Well, when the build.gradle file was created for you by Intellij's project starter, it also created a task called &lt;strong&gt;'runIde'&lt;/strong&gt;. When executed, this task launches a development instance of an IDE with your plugin code enabled. I won't go too deep into the rabbit hole here about how to control the settings for the development instance as it is quite detailed. But you can find some extremely useful info about it &lt;a href="https://www.jetbrains.org/intellij/sdk/docs/basics/ide_development_instance.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using other libs alongside Intellij APIs&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I generally like to use Spring/Spring Boot for most of the Java development projects I work on. Spring IOC and dependency injection are usually a must for me when it comes to projects with more than a few classes and interfaces. Unfortunately, I had a good bit of trouble getting Spring to play nice when it came to the plugin platform. I especially had trouble getting beans properly initialized. &lt;/p&gt;

&lt;p&gt;Usually with Spring Boot, you simply specify an initialization class with a main method that executes and initializes the Spring context when the application is run. Plugins don't work like that though. In order to run code at application startup for a plugin, you have to define an application component in the plugin.xml and then write an implementation class for the application component. I'm not really sure why, but no matter what I tried, I could not get a Spring context initialized in an application component. I tried both Spring Boot, and vanilla Spring, and could never get either to initialize properly. I eventually ended up moving on without dependency injection and IOC, which was definitely missed, but I managed OK without it 😉.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Documentation and examples for JetBrains specific stuff was scarce...&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I had a somewhat difficult time finding good resources online supporting JetBrains plugin developers. Besides the official JetBrains SDK documentation, Intellij API documentation was scant. I couldn't find any JavaDoc'ed reference documentation for the Intellij APIs, which was kinda frustrating when I needed to reference method parameters and return types, or just to see a description of a particular class or interface. A lot of times, I ended up just having to navigate to the compiled classes in Intellij to view comments and specifics for parameters and such. This is obviously less than ideal, but still doable. And... there maybe better documentation out there, I just couldn't find it.&lt;/p&gt;

&lt;p&gt;As far as examples and sample code of how to do stuff with the Intellij APIs, I had a little bit more luck, but still couldn't find a whole lot on the web. Here is a list of some of the resources I found online that helped me along the way while I was developing my plugin:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.jetbrains.org/intellij/sdk/docs/intro/welcome.html"&gt;JetBrains SDK Dev Guide&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;The SDK Dev Guide is definitely the place to go to get started. The Dev Guide is full of useful information about the plugin platform architecture, how to develop against specific products, testing strategies, etc. Keep in mind though, the Dev Guide has lots of useful info, but there is very little sample code or examples of how to do stuff here.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.plugin-dev.com/intellij/general/"&gt;Plugin-Dev&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Plugin-Dev is a blog by the creator of the Bash Support and Bash Support Pro plugins for Intellij (Joachim Ansorg). He's posted some very useful articles here that provide info and example code for how to do a few vital tasks for developing quality plugins. His articles encompass things like implementing proper error reporting, plugin initialization code, and code completion. Unfortunately, there isn't a whole lot of content on this blog. But the stuff that is there is money 💵!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/JetBrains/intellij-sdk-code-samples"&gt;GitHub - Intellij SDK code samples&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;This GitHub repo contains lots of samples for common Intellij API specific implementations. Implementing actions, working with the editor, and tool window basics are a just a few of the tasks that this blog helped me with while I was developing my plugin. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.baeldung.com/intellij-new-custom-plugin"&gt;Baeldung&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;The great Baeldung Java blog also a sweet post about writing plugins for Intellij. Though the information presented is pretty useful, its also a fairly simple plugin example. This post isn't much use if you are looking for samples of more advanced plugin implementations. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the resources I found on the web that helped me along the way. If you decide to build a plugin of your own, hopefully you'll be able to find a few more useful resources than I was able to.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Finally ready to release and launch 🚀!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So you've finished building and testing your awesome plugin...now what? Before JetBrains introduced the plugin marketplace, all you had to do was optionally obfuscate your codebase, build the archive file for your plugin, and upload it to the plugin repo. Easy right? The only problem with this is that the plugin you poured blood, sweat, and time into was publicly available to anybody for FREE. If you wanted to monetize your hard work, you'd need to either build your own licensing and sales solution, or find a good one to use on the web. &lt;/p&gt;

&lt;p&gt;The JetBrains plugin marketplace has opened up the opportunity for plugin developers to make money off the hard work they've put into their product. Although the process for releasing a plugin into the marketplace still seems to be a work in progress, overall, I've been pretty impressed with everything so far. &lt;/p&gt;

&lt;p&gt;The marketplace provides the same licensing and sales solution that JetBrains themselves use for licensing their IDE products. They provide a few different licensing options that you can take advantage of, including perpetual fallback licenses, but all of their license options appear to be subscription based (i.e. monthly or annually). I was actually a little disappointed that there was no simple perpetual license (one-time payment) option. Some products just don't fit a subscription business model, and having a one time payment option would be beneficial I think. Supposedly, they are working on offering that option for the near future though 🤞🏽. &lt;/p&gt;

&lt;p&gt;The process for getting a plugin approved for release in the marketplace is pretty straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send a request to sell plugins in the marketplace.&lt;/li&gt;
&lt;li&gt;Upon request acceptance, JetBrains will issue you a product code for your plugin.&lt;/li&gt;
&lt;li&gt;Add the product code to your plugin.xml file.&lt;/li&gt;
&lt;li&gt;Optionally obfuscate your plugin's codebase.

&lt;ul&gt;
&lt;li&gt;NOTE: I tried to obfuscate my plugin's codebase with ProGuard and it broke some of my plugin's functionality. I think it had something to do with the obfuscation of the Intellij API. I only tried one obfuscator, maybe another obfuscator (i.e. Zelix Klassmaster) would work better.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Test your plugin in the demo marketplace.

&lt;ul&gt;
&lt;li&gt;So JetBrains has gone through the trouble of standing up a test marketplace for us plugin devs to test out the marketplace solution. JetBrains staff works with you directly to ensure you have everything needed to get your plugin uploaded to the demo marketplace for testing. They even go so far as to set up a Slack channel to communicate with you while you are testing your plugin. It's pretty awesome 😀!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Release your plugin into the wild!!!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I found the process very thorough, but not overly complicated.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;So...what did I build?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxa1j6pz8zwup1emjr7gd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxa1j6pz8zwup1emjr7gd.png" alt="Alt Text" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After all that, you may be wondering what I built that spawned this thought dump. Well...I wrote a pretty nice post about the plugin that I just finished building and releasing in the plugin marketplace right here on DEV. &lt;a href="https://dev.to/clmoten84/showdev-an-evernote-integration-plugin-for-jetbrains-ides-2ac3"&gt;&lt;strong&gt;Check it out!&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post kinda says it all so I'll keep it short and simple here... I built a useful notes plugin that integrates the Evernote note taking service right into your JetBrains IDE. The plugin works in ALL JetBrains IDEs (i.e. Intellij IDEA, PyCharm, WebStorm, PhpStorm, etc.) and makes for a pretty sweet code snippet tool that you can use without ever having to leave the cozy confines of your development environment.&lt;/p&gt;

&lt;p&gt;So if you are a JetBrains user and need a boost to your productivity, check out &lt;a href="https://plugins.jetbrains.com/plugin/14519-spellbook"&gt;&lt;strong&gt;Spellbook&lt;/strong&gt;&lt;/a&gt; or the FREE but limited &lt;a href="https://plugins.jetbrains.com/plugin/14545-spellbook-basic"&gt;&lt;strong&gt;Spellbook Basic&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So I hope I haven't scared anyone away from deciding to build commercial plugins for the JetBrains plugin marketplace. Though there are some pain points, the overall experience was not bad at all, and at the end of the day there's a plugin that I worked my ass off on in the marketplace that can maybe make me a buck or two some day 🤞🏽🙏🏽. I'm super pumped that JetBrains has released this solution to support their plugin devs and look forward to building more in the future. After all, anybody who puts their all into building something deserves to be paid for it.&lt;/p&gt;

&lt;p&gt;Cheers 🍻!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>productivity</category>
      <category>showdev</category>
      <category>java</category>
    </item>
    <item>
      <title>ShowDev: An Evernote integration plugin for JetBrains IDEs</title>
      <dc:creator>Corey Moten</dc:creator>
      <pubDate>Fri, 19 Jun 2020 17:24:36 +0000</pubDate>
      <link>https://forem.com/mediocre_dev/showdev-an-evernote-integration-plugin-for-jetbrains-ides-2ac3</link>
      <guid>https://forem.com/mediocre_dev/showdev-an-evernote-integration-plugin-for-jetbrains-ides-2ac3</guid>
      <description>&lt;p&gt;TLDR; I built 🏗️ and just recently launched 🚀 an awesome notes plugin for JetBrains IDEs that integrates the Evernote note taking service into the IDE. Its called Spellbook! &lt;a href="https://www.getspellbook.dev"&gt;&lt;strong&gt;Check it out&lt;/strong&gt;&lt;/a&gt;! You can try out the paid version for 30 days for &lt;a href="https://plugins.jetbrains.com/plugin/14519-spellbook"&gt;&lt;strong&gt;FREE&lt;/strong&gt;&lt;/a&gt;! You can also try the ALWAYS FREE &lt;a href="https://plugins.jetbrains.com/plugin/14545-spellbook-basic"&gt;&lt;strong&gt;Spellbook Basic&lt;/strong&gt;&lt;/a&gt;, which has a limited feature set of its paid counterpart. &lt;/p&gt;

&lt;p&gt;I use Evernote as basically a development knowledge repository. I use it to store code snippets, implementation notes, stack overflow screenshots, commonly used git commands...if it's reusable, I probably have it saved in my Evernote account lol. But when I'm working in my IDE and I need to access this information repo, I always have to leave my IDE and go to the browser. I wanted an easy way to access the development knowledge archived in my Evernote account without needing to break my focus, leave my IDE, and go to the browser or some other app. So... I built my own solution for Intellij using the Evernote API.&lt;/p&gt;

&lt;p&gt;I didn't actually realize how much I really needed a tool like this until I started using a very basic alpha version of the plugin in Intellij 🤯. Before Spellbook, when I wanted to access my "knowledge repo" in Evernote to find a code snippet, I had to leave the cozy confines of my development environment and go to the browser, which sometimes, for me, was less than productive. I'd quickly find myself on reddit, or hacker news, or DEV reading cool stuff instead of actually working 🤦🏽. There's lots of scientific evidence that shows that context switching can absolutely destroy productivity, particularly for very thought intensive work like programming. This doesn't just apply to tasks, but also apps and tools as well. It's simple, the more apps a developer has to manage while working, the lower his/her productivity.&lt;/p&gt;

&lt;p&gt;I can say that my productivity has definitely jumped since using this plugin, as I'm spending less time in the browser and more time in my IDE getting work done. I figured if I benefitted so much from this tool, then maybe other devs would too. So I took the alpha version, developed a few more useful features and released the plugin in the JetBrains marketplace.&lt;br&gt;
I also released a simplified FREE version of the plugin that contains a limited feature set, but still allows developers to reap the benefits of accessing Evernote from the IDE (Spellbook Basic).&lt;/p&gt;

&lt;p&gt;So, if you use any JetBrains IDE (Intellij, PyCharm, WebStorm, etc.) &lt;strong&gt;AND&lt;/strong&gt; you use or want to use Evernote as a repo of software development awesomeness &lt;strong&gt;AND&lt;/strong&gt; you want an easy way to access that repo right from your IDE give &lt;a href="https://www.getspellbook.dev"&gt;&lt;strong&gt;Spellbook&lt;/strong&gt;&lt;/a&gt; a look see!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://plugins.jetbrains.com/plugin/14519-spellbook"&gt;&lt;strong&gt;Get Spellbook&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://plugins.jetbrains.com/plugin/14545-spellbook-basic"&gt;&lt;strong&gt;Get Spellbook Basic&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ALSO FYI - I'm working to integrate additional note and code snippet services into Spellbook to make it even more accessible to more devs. &lt;strong&gt;GitLab Code Snippets&lt;/strong&gt; and &lt;strong&gt;GitHub Gists&lt;/strong&gt; are the next integrations coming to Spellbook in v2. So... if you use a particular note service and would like to see it integrated into Spellbook in the future, please leave a comment or shoot me an email - &lt;a href="mailto:getspellbook@gmail.com"&gt;getspellbook@gmail.com&lt;/a&gt; - and I'll see what I can do!&lt;/p&gt;

&lt;p&gt;Cheers 🍻&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>productivity</category>
      <category>evernote</category>
      <category>jetbrains</category>
    </item>
    <item>
      <title>A Mediocre Dev Idea (feedback welcome)</title>
      <dc:creator>Corey Moten</dc:creator>
      <pubDate>Wed, 10 Jun 2020 22:05:53 +0000</pubDate>
      <link>https://forem.com/mediocre_dev/a-mediocre-dev-idea-feedback-welcome-43dg</link>
      <guid>https://forem.com/mediocre_dev/a-mediocre-dev-idea-feedback-welcome-43dg</guid>
      <description>&lt;p&gt;This idea has been floating around my head for a few months now, but I'm wondering if it is at all worthwhile.&lt;/p&gt;

&lt;p&gt;What do you think of an online community for software devs, architects, sys admins... really any type of IT role with the focus of the community around mistakes made and lessons learned? The tentative name floating around my head is MediocreDev.&lt;/p&gt;

&lt;p&gt;I was at work a couple months ago talking shop with some of my more senior engineer colleagues, and they had so many hilarious horror stories about seemingly innocuous coding errors and erroneous system configs that had disastrous effects when deployed into production. I realized that not only were these stories very entertaining, but they were also pretty informative. They learned many lessons from these mistakes and were now imparting that knowledge to me so that I would not repeat the same mistakes that they had already made in the past. Of course, being engineers, we had good debate about possible solutions and remedies to these mistakes, resulting in good dialog about best practices as it related to those mistakes.&lt;/p&gt;

&lt;p&gt;After this discussion, I thought it would be kinda cool to turn this interaction into a website. I mean, every person in IT has made or seen at least a few mistakes during their career that had a negative net effect, whether it be on business operations, product development, or whatever. We should be sharing these stories with each other to help make each other better engineers. If enough users use the community, it could potentially even turn into sort of a best practices platform that other IT people can search just to get perspective around a particular technology or strategy before they attempt it. Pie in the sky stuff I know, but I do see some value in engineers sharing this kind of information with each other.&lt;/p&gt;

&lt;p&gt;I haven't attempted to start building this idea for a couple reasons:&lt;/p&gt;

&lt;p&gt;1) Time: I just haven't had time to sit down and try to plan how to build this&lt;br&gt;
2) Validation: I'm not sure if this is something other IT people would even be interested in using.&lt;br&gt;
3) Motivation: I'm not super excited about attempting to build an online community. Mainly because I don't think I'd have the patience necessary to build up the community. That being said, if this community existed, I would use it. Though I don't think that is enough of a reason to try to build something like an online community.&lt;/p&gt;

&lt;p&gt;I was hoping to get some feedback about this idea. Would any of you all use an online community like this? Do you know of any other online communities already out there similar to this? What would it take to get any of you IT guys and gals to consistently visit and participate in a community like this?&lt;/p&gt;

&lt;p&gt;Thanks and stay safe&lt;/p&gt;

</description>
      <category>idea</category>
      <category>validation</category>
      <category>community</category>
      <category>sideprojects</category>
    </item>
  </channel>
</rss>
