In Confluence how to create own java and vm(velocity) file

In confluence how to create own java and vm file and map java class object and access that object in Velocity

3 answers

1 accepted

May I suggest that you consider using Soy templates instead of Velocity? Soy templates are used by the newer Atlassian products, and I believe the plan is to use them in new features added to JIRA and Confluence. In any case, Atlassian appears to be moving towards Soy and away from Velocity.

There is a suitable tutorial on using Soy templates in Confluence.

The documentation for Soy templates is published by Google.

If you insist on using Velocity, then the Velocity User Guide will be very handy, as will the Velocity Template Overview for Confluence.

David Simpson Community Champion Jun 16, 2013

Oh yes, I can recommend that tutorial on Soy templates ;)

Full source code is available for it here:

0 vote

Generally, you'll want to create a plugin to bundle all your code together and make it interact. Your other questions mention Confluence, so I'd start at

Even if this is not the right approach for your answer, the process of working through writing a plugin will teach you the basic stuff you need to understand to write code for Confluence, especially how java and velocity interact

thanks both of you i will try

Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

46 views 1 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot