Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Adding functionality into SIL means that you need to create an Atlassian add-on. Add-ons are basically JAR files containing an a descriptor (atlassian-plugin.xml). So let's create one, skipping the tools that Atlassian provides, because there's too much to be customized as you will see soon enough.

So, first thing to do is to create Create a skeleton maven project; , name it how you want , and choose a directory where the project will reside. Choose com.mycompany.silexample as a base package, where your sources will reside.

Upon finishing your IDE wizard, you will notice that there's a pom.xml in the root of the project. Open it and replace its content with the following:

...

This adds support for bean scanning , enabling you to annotate your components with stereotypes. 

Info

Starting with version 4.0.0, almost everything is a Spring Bean, almost everything. No more static dependencies, now you need to rely on the injection mechanism.

...

Our framework requires you to declare certain basic information about what you bring to SIL. As you saw, certain information can be placed in descriptor files, but some other is declarative, in Java, since that info will get injected into different places.

...

The bean implementation is quite straight-forwardstraightforward. This is a local component, not exported to the outside world; , this is what the @Component annotation is used for. 

Now, we need to register some certain routines and CF descriptors, and we you can do that at launch time of the plugin. The start-stop sequence of plugins in complicated enough therefore we 'll use our own Launcher class, abstracting all those events in such a way that you will know that whatever you do, it is safe to be done. So, lets extend / implement com.keplerrominfo.refapp.launcher.AbstractPluginLauncher: create an ExampleLauncher class within the same package (com.mycompany.silexample). Override doAtLaunch() and doAtStop() members.

...

You will notice some (now un-usedunused) imported beans, we will use them to declare the new routine and the new CF descriptor.