Is Surefire (Maven) able to run several executions of surefire with different versions of dependencies? If yes, how?
===

I wonder if it's possible to have the Maven Surefire plugin running several times (several executions) with different different versions of dependencies ?

This could be convenient for example to ensure that your code is still compatible with previous versions of project's dependencies.

I manage at least to run 2 executions of surefire :


          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
            <executions>
              <execution>
                <id>test-default-deps</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <skip>false</skip>
                </configuration>
              </execution>
              <execution>
                <id>test-anotherversion-deps</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <skip>false</skip>
                  <reportsDirectory>${project.build.directory}/surefire-reports-anotherversion-deps</reportsDirectory>
                  <dependencies>
                    
                    <!-- Version different of the default for the project -->
                    <dependency>
                      <groupId>com.dep.groupid</groupId>
                      <artifactId>dep-artifact</artifactId>
                      <version>anotherversion</version>
                    </dependency>

                  </dependencies>
                </configuration>
              </execution>
            </executions>
          </plugin>

But this different version is not taken into account during the 2nd execution.
Am I trying to do something unfeasible or am I doing in the wrong way ?
Is there another plugin that could be helpful for this purpose ?