The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

unit/integration test configuration overrride

Alexander Wagner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 21, 2024

Hi, 

I am developing a jira plugin. I started writing tests and I saw the jira-maven-plugin uses surefire and failsafe plugin under the hood (I guess). I got some problems running integration test. After I found the way where test class needs to be placed I tried to change the configuration of both plugins but I was not successful. My question is:

How can I change both configurations (espacially the include/exlude pattern)?

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Hugo Mora
Contributor
September 4, 2026

Hi Alexander,

Short answer: don't fight it with executions — just declare the plugins with a configuration block and AMPS merges it in.

AMPS doesn't bind surefire/failsafe to the lifecycle the normal way. It invokes those goals itself (via MojoExecutor) so the ITs run in the window between the host app starting and shutting down. But AMPS is meant to respect any configuration you provide in the build/plugins section of your POM. So:

<build>
<plugins>
<!-- unit tests: atlas-unit-test / mvn test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes><include>**/*UnitTest.java</include></includes>
<excludes><exclude>it/**</exclude></excludes>
</configuration>
</plugin>
<!-- integration tests: atlas-integration-test / mvn integration-test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes><include>it/**/*Test.java</include></includes>
</configuration>
</plugin>
</plugins>
</build>

No version element, no executions, no phase. If you add executions of your own they'll fire outside the AMPS window and the host application won't be up — which is usually why people see "Confluence/Jira starts, stops, no tests ran".

Two things that trip people up:

  • The it package is the default for a reason. AMPS runs all the tests in your project's it package against the started host application, with ut the convention for unit tests. If you just move your IT classes under src/test/java/it/... and name them *Test.java, you may not need to override anything.
  • The dependencies section of those plugins is not merged, only the configuration section — that's AMPS-1553. So if your tests need a specific provider (JUnit 5, JUnit 4.7+, Spock), you have to point at it via configuration rather than by adding a provider dependency. Worth checking if your tests compile but silently never execute.

For quick ad-hoc filtering, -Dtest= and -Dit.test= work as usual.

--Hugo

TAGS
AUG Leaders

Atlassian Community Events