Skip to content

Commit

Permalink
[SUREFIRE-1972] Use current version of surefire-shared-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibor17 committed Jan 17, 2022
1 parent 909637c commit ad5f7a1
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 23 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/maven-verify.yml
Expand Up @@ -26,8 +26,10 @@ jobs:
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v2
with:
ff-goal: 'install'
verify-goal: 'install -P run-its'
ff-goal: 'clean install -nsu -P run-its'
ff-site-goal: 'clean install site -nsu -DskipTests -P reporting'
verify-goal: 'clean install -nsu -P run-its'
verify-site-goal: 'clean install site -nsu -DskipTests -P reporting'
verify-fail-fast: false
failure-upload-path: |
surefire-its/target/*/log.txt
Expand Down
2 changes: 1 addition & 1 deletion maven-failsafe-plugin/pom.xml
Expand Up @@ -266,12 +266,12 @@
<postBuildHookScript>verify</postBuildHookScript>
<settingsFile>src/it/settings.xml</settingsFile>
<skipInvocation>${skipTests}</skipInvocation>
<streamLogs>true</streamLogs>
<showErrors>true</showErrors>
<properties>
<integration-test-port>${failsafe-integration-test-port}</integration-test-port>
<integration-test-stop-port>${failsafe-integration-test-stop-port}</integration-test-stop-port>
</properties>
<debug>true</debug>
</configuration>
</execution>
</executions>
Expand Down
2 changes: 1 addition & 1 deletion maven-surefire-common/pom.xml
Expand Up @@ -74,7 +74,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
<version>3.0.0-M4</version>
<version>${surefire-shared-utils.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
16 changes: 13 additions & 3 deletions pom.xml
Expand Up @@ -48,6 +48,7 @@
</contributors>

<modules>
<module>surefire-shared-utils</module>
<module>surefire-logger-api</module>
<module>surefire-api</module>
<module>surefire-extensions-api</module>
Expand All @@ -62,7 +63,6 @@
<module>maven-failsafe-plugin</module>
<module>maven-surefire-report-plugin</module>
<module>surefire-its</module>
<module>surefire-shared-utils</module>
</modules>

<scm>
Expand Down Expand Up @@ -101,6 +101,7 @@
<powermockVersion>2.0.9</powermockVersion>
<mavenPluginToolsVersion>3.6.2</mavenPluginToolsVersion>
<jacocoVersion>0.8.7</jacocoVersion>
<surefire-shared-utils.version>${project.version}</surefire-shared-utils.version>
<maven.surefire.scm.devConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
<maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
<maven.compiler.testSource>1.${javaVersion}</maven.compiler.testSource>
Expand Down Expand Up @@ -687,7 +688,17 @@
</reporting>

<profiles>

<profile>
<!-- First, install the project without tests -> mvn install -DskipTests
This is a workaround for IntelliJ IDEA, see https://youtrack.jetbrains.com/issue/IDEA-148573
IDEA is able to recognize external artifacts with classifiers. But IDEA expects modules and their artifacts
without classifier. If the version differs from project, the idea would understand it as external artifact.
-->
<id>ide-development</id>
<properties>
<surefire-shared-utils.version>3-SNAPSHOT</surefire-shared-utils.version>
</properties>
</profile>
<profile>
<id>jdk9+</id>
<activation>
Expand All @@ -697,7 +708,6 @@
<jvm9ArgsTests>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED --add-opens java.base/sun.nio.cs=ALL-UNNAMED --add-opens java.base/java.nio.file=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED</jvm9ArgsTests>
</properties>
</profile>

<profile>
<id>reporting</id>
<reporting>
Expand Down
2 changes: 1 addition & 1 deletion surefire-api/pom.xml
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
<version>3.0.0-M4</version>
<version>${surefire-shared-utils.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
3 changes: 2 additions & 1 deletion surefire-booter/pom.xml
Expand Up @@ -115,11 +115,12 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shadefire</artifactId>
<version>3.0.0-M4</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 -->
<version>3.0.0-M3</version> <!-- ${shadedVersion}, but resolved due to https://issues.apache.org/jira/browse/MRELEASE-799 -->
</dependency>
</dependencies>
<configuration>
Expand Down
Expand Up @@ -56,6 +56,8 @@
public class NewClassLoaderRunner
extends BlockJUnit4ClassRunner
{
private static final String PROJECT_DIR = System.getProperty( "java.dir" );

private Class<?> cls;

public NewClassLoaderRunner( Class<?> clazz )
Expand Down Expand Up @@ -236,17 +238,14 @@ private static Collection<URL> toPathList()
Collection<URL> classPath = new HashSet<>();
try
{
String[] files = FileUtils.fileRead( new File( "target/test-classpath/cp.txt" ), "UTF-8" )
.split( pathSeparator );
File classPathFile = new File( PROJECT_DIR, "target/test-classpath/cp.txt" );
String[] files = FileUtils.fileRead( classPathFile, "UTF-8" ).split( pathSeparator );
for ( String file : files )
{
File f = new File( file );
File dir = f.getParentFile();
classPath.add(
( dir.getName().equals( "target" ) ? new File( dir, "classes" ) : f ).toURI().toURL() );
classPath.add( new File( file ).toURI().toURL() );
}
classPath.add( new File( "target/classes" ).toURI().toURL() );
classPath.add( new File( "target/test-classes" ).toURI().toURL() );
classPath.add( new File( PROJECT_DIR, "target/classes" ).toURI().toURL() );
classPath.add( new File( PROJECT_DIR, "target/test-classes" ).toURI().toURL() );
}
catch ( IOException e )
{
Expand Down
2 changes: 1 addition & 1 deletion surefire-extensions-api/pom.xml
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
<version>3.0.0-M4</version>
<version>${surefire-shared-utils.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
2 changes: 1 addition & 1 deletion surefire-its/pom.xml
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-report-parser</artifactId>
<version>${project.version}</version>
<version>3.0.0-M5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion surefire-providers/common-java5/pom.xml
Expand Up @@ -35,7 +35,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
<version>3.0.0-M4</version>
<version>${surefire-shared-utils.version}</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion surefire-report-parser/pom.xml
Expand Up @@ -41,7 +41,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-shared-utils</artifactId>
<version>3.0.0-M4</version>
<version>${surefire-shared-utils.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
Expand Down
36 changes: 34 additions & 2 deletions surefire-shared-utils/pom.xml
Expand Up @@ -29,7 +29,9 @@

<artifactId>surefire-shared-utils</artifactId>
<name>Surefire Shared Utils</name>
<description>Relocated Java packages of maven-shared-utils in Surefire</description>
<description>
Relocated Java packages of maven-shared-utils and several Apache Commons utilities in Surefire.
</description>

<licenses>
<license>
Expand Down Expand Up @@ -100,5 +102,35 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<!-- First, install the project without tests -> mvn install -DskipTests
This is a workaround for IntelliJ IDEA, see https://youtrack.jetbrains.com/issue/IDEA-148573
IDEA is able to recognize external artifacts with classifiers. But IDEA expects modules and their artifacts
without classifier. If the version differs from project, the idea would understand it as external artifact.
-->
<id>ide-development</id>
<build>
<plugins>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>install-devel-jar</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<artifactId>surefire-shared-utils</artifactId>
<version>3-SNAPSHOT</version>
<file>target/${project.build.finalName}.jar</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit ad5f7a1

Please sign in to comment.