Advanced Maven Failsafe Configurations plus AMPS

I’m trying to make AMPS run some integration tests that are a bit off their beaten path. While my tests compile just fine, the version of Surefire that comes bundled with AMPS cannot execute them.

I’ve debugged this to the point that I’m confident that what I need to do is register a custom provider, as described at https://maven.apache.org/surefire/maven-failsafe-plugin/examples/providers.html .

The trouble is, I have no way to mess with the block for the version of the Surefire plugin that’s included in AMPS.

I’ve tried providing my own custom configuration for the maven failsafe plugin in my pom.xml file:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven.failsafe.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${maven.failsafe.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                        <phase>integration-test</phase>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- The parent pom adds some standard dependencies, but these are the important ones -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>${maven.failsafe.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

AMPS doesn’t run those tests during the integration-test phase because the JUnit47 provider isn’t available. However, I can run mvn failsafe:integration-test and the test executes just fine.

I either need to find a way to make my own custom integration-test execution run at the right time (after Confluence has started up, but before it has shut down) OR I need to figure out how to change the Surefire/Failsafe plugin config.

Notably, I have this problem for apps across Confluence, Bitbucket, and Jira.

@KamilaCzubaj - I heard a rumor you might know things about this, and that shamelessly @ing you on a public forum might be a way to get an answer. So, here I am. :slight_smile:

Hi @jcarter, thank you for reaching out,
I will talk to the team and let you know.

Kind regards,
Kamila Czubaj
Senior Product Manager on the Server Platform

1 Like