Extending the Confluence Search Index

Developing plugins for the Confluence Wiki a developer sometimes needs to save additional metadata to a page object using Bandana or the ContentPropertyManager. Wouldn’t it be nice if this metadata was available in the built-in Lucene index? That is were the Confluence Extractor Module comes into play.. Overview An extractor allows the developer to add new fields to the lucene search index. Creating a new extractor is quite simple – just implement the interface com.atlassian.bonnie.search.Extractor or bucket.search.lucene.extractor.BaseAttachmentContentExtractor if you want to build a new file extractor. ...

May 23, 2010 · 4 min · 713 words · Micha Kops

Snippets: Getting License Information from the Confluence API

Sometimes one needs to look up license details of a running Confluence system .. perhaps for creating a commercial plugin or to display recommendations dependant from the license used. For this reason there are a few possibilities for receiving some license information from the Confluence API or the velocity context. Note: This article is outdated since the Atlassian Marketplace was launched and a shiny new licensing API was added. Until this article is updated I strongly recommend to take a closer look at the detailed information that Atlassian is providing in the Developer Documentation. ...

May 6, 2010 · 3 min · 637 words · Micha Kops

Manage dependencies with the Maven Dependency Plugin

In a maven project there are lots of dependencies to handle – often one wants to know which version of a software comes from. The solution to this problem is the Maven Dependency Plugin which helps you to find used/unused/declared/undeclared dependencies in your project. In addition the plugin allows you to copy or unpack artifacts. Maven Goals dependency:copy – copies artifacts defined in the config to a specified location – details available here dependency:resolve – resolves all dependencies and shows the versions dependency:go-offline – resolves everything the project needs like dependencies, plugins and reports dependency:analyze - parses the dependencies and shows if they are used/declared/unused/undeclared .. dependency:analyze-dep-gmt - finds mismatches between resolved dependencies and those listed in the dependencyManagement section dependency:tree – shows a nice dependency tree for the maven project ...

April 4, 2010 · 2 min · 321 words · Micha Kops

Linux Snippets

These are not only linux snippets but also bash snippets and snippets using tools that run under Linux, *nix or sometimes even MacOSX, I should reorder this article someday ;) Settings for more reliable bash scripts set -euo pipefail this gives us …​ -e: exit script if a single command fails -u: exit script if an unset variable is used -o pipefail: return value of a pipeline is the status of the last command to exit with a non-zero status, or zero if no command exited with a non-zero status ...

March 1, 2010 · 15 min · 3006 words · Micha Kops

Maven Snippets

Extract Coordinates from the POM Helpful for build and integration environments, pipelines etc. Exctract the Project version from the pom.xml mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout Override a Property via local configuration e.g. to override the property xxx from your project’s pom.xml Create a directory .mvn in your project directory root Create a file named maven.config in this directory Insert -Dxxx=newvalue into the file to override this property Don’t forget to add .mvn to your .gitignore! ...

March 1, 2010 · 2 min · 401 words · Micha Kops

Vim Snippets

Vim Plugin Manager Installation Download it from its GitHub repository or the risky but easy way using curl: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim Adding Plugins Add a plugin section to the .vimrc: .vimrc call plug#begin() " The default plugin directory will be as follows: " - Vim (Linux/macOS): '~/.vim/plugged' " - Vim (Windows): '~/vimfiles/plugged' " - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged' " You can specify a custom plugin directory by passing it as the argument " - e.g. `call plug#begin('~/.vim/plugged')` " - Avoid using standard Vim directory names like 'plugin' " Make sure you use single quotes " Gruvbox Theme Plug 'sainnhe/gruvbox-material' " Initialize plugin system " - Automatically executes `filetype plugin indent on` and `syntax enable`. call plug#end() " You can revert the settings after the call like so: " filetype indent off " Disable file-type-specific indentation " syntax off " Disable syntax highlighting ...

March 1, 2010 · 3 min · 568 words · Micha Kops