Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Change addons source files

Amir June 7, 2021

How can I change & edit an addon's macro. for example some addon has a macro to show something or create a page or a template and I want to edit and customize a section or a part of that template or macro?

Thanks

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 7, 2021

It depends on how the app is built and where it's doing the work you want to change.

A typical app that provides a Confluence macro is a .jar file you add to your server.  .jar files in general are really zipped up blocks of files that are suitable for java to use as an executable set of instructions and supporting resources. 

For Atlassian apps, the files tend to be a mix of usable classes and resources which feed into displaying and rendering stuff - some javascript, css, jsp, etc, and quite often, velocity templates which are usually about displaying a macro when rendered (my first confluence app was 3 small classes and an over-engineered velocity template, as I found it easier to code for velocity than java at the time). These resources are plain text, but are effectively code (unlike the classes which are the results of compiled code)

So.  If what you want to change is being done by templates or resources, you could unzip the app, hack the text files and re-zip the file, then re-deploy it over the top of the old one in your server.

But if the changes you want are done in the compiled code, you are not going to be able to do that (without a pile of reverse engineering)

None of that can be recommended at any point, what you really should do is get the source code for the app and recompile it properly after making your changes in the source.  If you hack someone else's app, you could be breaching the terms of usage, you're certainly going to leave yourself unsupported with that app, and if it's one of the core Confluence apps, your entire Confluence system goes out of support (in all cases, keep the original .jar file handy - you can become supported again by deleting your version and putting the original back)

Amir June 7, 2021

Thanks for your answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events