5

I'm trying to deploy a war file for local development and I want to modify tomcat's context.xml to provide datasource via jndi. This works when using tomcat7-maven-plugin:

        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <contextFile>../../tomcat-test-context.xml</contextFile>
            </configuration>
        </plugin>

The problem is, that tomcat7-maven-plugin doesn't work with overlays which I use in the project, so I have to use another approach. I can deploy the war artifact in intellij idea, but I don't see any option to specify the contextFile like in the tomcat7-maven-plugin. Is there some option to do similar thing in intellij idea tomcat configuration?

Of course I can modify the context.xml under the catalina home, but I'd like to have it configured per project and don't want to have many tomcats.

The application is deployed on weblogic in production and I use tomcat only locally for testing.

NeplatnyUdaj
  • 5,722
  • 4
  • 41
  • 72

1 Answers1

0

Not sure if this will help, but here how I did it:

  1. In IntelliJ, under webapp, I created META-INF folder -> context.xml and defined my Resource
  2. Then I had to look it up in my Java code (JDNI lookup) as described in the accepted answer here: Tomcat and JDBC connection pooling
SecretAgentMan
  • 2,756
  • 6
  • 18
  • 38
msTam
  • 133
  • 2
  • 6