[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 Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

22,692 views 2 7
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