I'm using the Maven Integration Testing Framework plugin to test one goal of a custom-developed plugin. As far as the tests go, everything works well. However, there is one unexpected and undesired technicality that I have noticed:
The local repositories created for individual test cases in target/maven-it/.../test-case/.m2/repository
are always populated remotely - from the Maven Central Repository. If I run mvn clean integration-test
without being connected to the Internet, the dependency resolution results in an error after a failed connection attempt. I would expect it, however, to look for the dependencies in the "standard" cache located in USER/.m2/repository
first, where the dependencies were already present in my experiment.
It's interesting that even after adding the --offline
option to mvn clean integration-test
, online dependency resolution is still attempted.
My main question is - should this be happening? Is this the expected behavior when using the Maven Integration Testing Framework? Or do you think there might be something wrong with the way I'm using it?
Related dependencies from the pom.xml
of the tested custom-developed plugin:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>${junit.platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.16.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.soebes.itf.jupiter.extension</groupId>
<artifactId>itf-jupiter-extension</artifactId>
<version>0.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.soebes.itf.jupiter.extension</groupId>
<artifactId>itf-assertj</artifactId>
<version>0.11.0</version>
<scope>test</scope>
</dependency>
Related plugins:
<plugin>
<groupId>com.soebes.itf.jupiter.extension</groupId>
<artifactId>itf-maven-plugin</artifactId>
<version>0.11.0</version>
<executions>
<execution>
<id>installing</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install</goal>
<goal>resources-its</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<systemProperties>
<maven.version>${maven.version}</maven.version>
<maven.home>${maven.home}</maven.home>
</systemProperties>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
$HOME/.m2/repository
it could happen that parts which are already in the local cache influence the integration test. That's one of the the reasons each integration tests is completely separated from each other test. Furthermore it makes it possible to parallelise the integration tests. Furthermore you can configure your ownsettings.xml
to consume any dependencies from a repository instead directory from central this would also mean that the integration test would consume their deps from that repo manager...