How to find out org.springframework version used by UPM

In this sample jira event listener plugin, it says “The org.springframework version should match the version used by the UPM”. How do I find out what version the UPM uses? The Jira version is 7.2.6

I’m guessing that the reason that the tutorial references the osgi framework is for the DisposableBean and InitializingBean pieces.

You can skip those though and just use the LifecycleAware interface from SAL (much nicer :slight_smile: ). Just do a dependency on sal api in your pom:

 <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
        </dependency>

Then in your code:


public class MyEventListener  implements LifecycleAware
{
    private final EventPublisher eventPublisher;

    public WittifiedSchedulerStartup( final EventPublisher eventPublisher)
    {
        this.eventPublisher = eventPublisher;
    }

    
    @Override
    public void onStart()
    {
        eventPublisher.register(this);

    }

    @Override
    public void onStop()
	{
        eventPublisher.unregister(this);
    }



    @EventListener
    public void someEventFunction(MyEvent event)
    {
// do stuff ....
    }

}

2 Likes

Hi there. I’m trying to build a listener too.
It seems that your solution is working? But I don’t know where to put the Java Code, if I can’t put Components in the “atlassian-plugin.xml”. It’s a bit confusing.
Could you please help? Thanks.

Can someone tell me how the pom.xml would look like?

From 2 years ago: Differences between Spring and Pico

This indicates that ALL v2 plugins use Spring 2.5.

Is this still valid? Who knows. I have found numerous unversioned documentation URLs (no 7.2.1, etc in the URL, so I assume it is “latest”) that have extremely out-dated information on them.