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.
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.
Checkout the branch bugfix/SRPLAT-1250-experiment-with-goals-and-executions
cd into the confluence subproject
Run mvn clean verify to reproduce the problem. You should see that Confluence starts and stops, but does not run the tests.
For something to compare to, you can run mvn confluence:debug to start Confluence, then invoke Failsafe directly to see a working test run using mvn failsafe:integration-test -Dbaseurl="http://localhost:8080/confluence".
Sorry to bother you again Jonny, but I get this when running mvn install on that branch of the scriptrunner-parent-pom project:
[ ERROR ] Failed to execute goal on project scriptrunner-bamboo-standard: Could not resolve dependencies for project com.adaptavist.pom:scriptrunner-bamboo-standard:pom:32-SNAPSHOT: Could not find artifact com.onresolve.bamboo.groovy:groovyrunner:jar:5.4.19 in maven-atlassian-com (https://packages.atlassian.com/maven/repository/internal) → [Help 1]
<repositories>
<!-- This is required to find the parent pom and ScriptRunner dependencies -->
<repository>
<id>adaptavist-external</id>
<url>https://nexus.adaptavist.com/content/repositories/external</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
</repositories>
The best that I can figure is that there’s something in our poms that presumes our own internally presumed development environment setup (which does include adding our Nexus repo to your maven profile config).
However, even if I move my maven config files (~/.m2/settings.xml and ~/.m2/settings-security.xml) and do a mvn clean install, I’m able to download those dependencies and build the project.
I’m afraid I’m a bit like an ape with sticks when it comes to Maven, so this is probably some known issue that you will instantly recognize & school me.
Is there anything in your maven config that might prevent it from honoring the repositories in the base pom? Or can you tweak it to look at the above nexus repositories?
[quote=“jcarter, post:10, topic:42302”]
I suspect that the fundamental cause of the problem is that while AMPS does merge the <configuration> block of a build plugin, it doesn’t merge the <dependencies> block within the plugin’s configuration[/quote]
Yes, this indeed seems to be the cause of your problem. I’ll take a look at the AMPS ticket you logged. Let’s continue the discussion there.
are there any updates regarding this issue as I’m actually facing the exactly same problems.
I guess the discussion was continued here: [AMPS-1553] - Ecosystem Jira.
Hey, @ArberBushati. I’ve more or less moved on to other things since all this and gave up on trying to make AMPS work for my use case in the short term. If the AMPS team comes back with some insights, though, I might be compelled to take a look.