0

I have two applications (Maven 'war' artifact), let's call them Api and Ui.

I want to setup a fully automated integration test that fires up Api and Ui locally before executing integration tests.

The applications are losely-coupled and so I don't want to introduce any dependency on Api in Uis build or vice-versa.

So I want to setup a third project, IntegratedQA which will have dependencies on both apps.

My initial POM contains:

        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat8-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <path>/</path>
            </configuration>
            <executions>
                <execution>
                    <id>start-tomcat</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <fork>true</fork>
                    </configuration>
                </execution>
                <execution>
                    <id>stop-tomcat</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>shutdown</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

My question is... How exactly do I tell tomcat to launch Api.war and Ui.war, which are built in separate projects?

Alex R
  • 11,364
  • 15
  • 100
  • 180

1 Answers1

0

Using tomcat7-maven-plugin you can customize the tomcat7:deploy to provide the war files path to deploy into tomcat environment. browse this link for the documentation.

Linking another stackoverflow answer where it is specified how it will work with tomcat 8 or 9

Jenkins deploy war file to Tomcat 8

  • tomcat7:deploy pushes an app to an exiting instance of tomcat? but in this case I want to fire up an embedded instance – Alex R Nov 30 '19 at 18:37