[AMPS] How to use custom context.xml for jira started with maven-jira-plugin:run? Edited

Hi,
How to start jira (its tomcat to be precise) with custom conf/context.xml?

Long story:

In my testing environment i need to start two JIRAs. The problem is that, each JIRA lease the same session cookie file because its base urls are:

  • http://localhost:2990/jira
  • http://localhost:2991/jira

So acording to https://confluence.atlassian.com/jirakb/user-is-constantly-logged-out-of-jira-192872663.html i decided to try to change session cookie file name. I want to set custom session cookie file name for each instance. I am using tomcat8 right now. As far as i know to change this session cookie file name i need to set in <Context> element of my web application (JIRA in my case). So i did it manually and it works perfect. Here is my context.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<Context sessionCookieName="JIRA2990SESSIONID">
<Resource name="jdbc/JiraDS" type="javax.sql.DataSource" auth="Container" driverClassName="org.postgresql.Driver" factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory" password="xxxxxxx" url="jdbc:postgresql://localhost:5432/jira2990" username="jira2990"/>
<Resource name="UserTransaction" type="javax.transaction.UserTransaction" auth="Container" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
</Context>

How to configure my pom.xml to tell maven-jira-plugin/maven-amps-plugin to start jira with my custom context.xml?

I figured out it uses cargo-maven2-plugin under the hood but can i add/modify its configuration? How to do it?

 

1 answer

0 votes

I haven't experimented with a custom context.xml but there is another workaround you can try. You can use different context paths.

"--context-path /jira1" will set the context path of your first JIRA instances to http://localhost:2990/jira1 and so on. That should fix the session issue.

Check out https://developer.atlassian.com/server/framework/atlassian-sdk/atlas-run/ for the available options for atlas-run.

I already figured it out, but anyway, thanks Jobin!

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,756 views 11 18
Join discussion

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