Skip to content

Conversation

@scordio
Copy link
Member

@scordio scordio commented Feb 16, 2025

Deliverables

  • In-module testing is successfully applied for assertj-core
  • Module descriptor is added to assertj-guava
  • Modular testing is successfully applied to all assertj-tests modules except assertj-core-spring-boot
    • assertj-core-spring-boot remains on classpath testing due to the lack of module system support by some Spring Boot transitive dependencies
Co-authored-by: Daniel Lobão <lobaorn@users.noreply.github.com>
Co-authored-by: Christian Stein <sormuras@users.noreply.github.com>

@scordio scordio added this to the 4.0.0-M1 milestone Feb 16, 2025
@scordio scordio force-pushed the gh-3446-module-only-build branch from c9beba3 to 4144c91 Compare February 16, 2025 13:27
@scordio scordio added the theme: module system An issue related to the Java module system label Feb 16, 2025
@scordio scordio force-pushed the gh-3446-module-only-build branch 3 times, most recently from 845f687 to 3c8e39f Compare February 16, 2025 21:58
@scordio scordio force-pushed the gh-3446-module-only-build branch 9 times, most recently from 99f346a to f6dbc5f Compare February 26, 2025 18:34
@scordio scordio force-pushed the gh-3446-module-only-build branch 4 times, most recently from e8f4d48 to 09fcf7d Compare February 28, 2025 16:48
@scordio
Copy link
Member Author

scordio commented Feb 28, 2025

The current failures might benefit from #3185.

@scordio scordio force-pushed the gh-3446-module-only-build branch 2 times, most recently from 670bc68 to 8fc270b Compare March 1, 2025 09:54
@scordio scordio force-pushed the gh-3446-module-only-build branch 2 times, most recently from 2564bfc to 56408a0 Compare March 1, 2025 10:39
@scordio scordio force-pushed the gh-3446-module-only-build branch 2 times, most recently from 4c57861 to 49a144e Compare March 2, 2025 23:01
requires org.assertj.core;
requires org.junit.jupiter.params;
requires org.junitpioneer;
requires org.mockito;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mockito 5.16.0 now ships module descriptors 🎉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hint! I'll update and let you know 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TimvdLippe It seems there are some errors in our integration tests when upgrading Mockito from 5.15.2 to 5.16.0.

I'll dig a bit more and raise an issue with the details.

@scordio scordio force-pushed the gh-3446-module-only-build branch 5 times, most recently from 3f9f887 to 338a8a9 Compare March 5, 2025 17:43
@scordio
Copy link
Member Author

scordio commented Mar 5, 2025

The culprit of the Windows failures:

[DEBUG] Fork Channel [1] connected to the client.
The command line is too long.
[DEBUG] Closing the fork 1 after not saying Good Bye.

This is likely related to https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation, as the current command line has over 13k characters.

@scordio scordio force-pushed the gh-3446-module-only-build branch from 2d2b045 to c60a012 Compare March 5, 2025 23:32
@lobaorn
Copy link
Contributor

lobaorn commented Mar 6, 2025

!!Hey @scordio I think that maybe somthing like this can work to bypass the limitation of the argLine and move it to a file:

<properties>
  <argLine>@${project.build.directory}/jvm-args.txt</argLine>
</properties>

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-resources-plugin</artifactId>
  <executions>
    <execution>
      <id>generate-jvm-args</id>
      <phase>process-test-resources</phase>
      <goals>
        <goal>copy-resources</goal>
      </goals>
      <configuration>
        <outputDirectory>${project.build.directory}</outputDirectory>
        <resources>
          <resource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
            <includes>
              <include>jvm-args.txt</include>
            </includes>
          </resource>
        </resources>
      </configuration>
    </execution>
  </executions>
</plugin>

Tomorrow I can try locally, but I guess you committing and running the GHA would be easier/faster. I remember maybe something similar about length of argLines about mvnd as well, maybe @cstamas or @gnodet would know.

Edit: the default approach is using .mvn/jvm.config in the project directories themselves (of pom), but I am unsure of the behavior/inheritance between the pom hierarchy. But I guess one of the two approaches would suffice in this case.

@scordio
Copy link
Member Author

scordio commented Mar 6, 2025

Thanks for the suggestions, @lobaorn!

I'll try them and see how they cooperate with the IDE, as IDE out-of-the-box support is the big advantage of the current argLine approach.

@scordio scordio force-pushed the gh-3446-module-only-build branch from c60a012 to fb5f4d2 Compare March 6, 2025 21:50
--add-opens=java.base/java.math=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/sun.nio.fs=ALL-UNNAMED
@${project.basedir}/argFile
Copy link
Member Author

@scordio scordio Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kudos to @lobaorn and @sormuras – this seems to play nicely with both Maven and the IDE when on Windows 🙂

Reference: https://docs.oracle.com/en/java/javase/21/docs/specs/man/java.html#java-command-line-argument-files

I hope you don't mind being mentioned as co-authors when I finally merge this PR 😉

@scordio
Copy link
Member Author

scordio commented Mar 8, 2025

When working on #3442, I forgot to upgrade Mockito to version 5 in assertj-parent. I'll give it a try before merging.

@scordio scordio force-pushed the gh-3446-module-only-build branch from aea8523 to 5818678 Compare March 9, 2025 10:44
@scordio scordio marked this pull request as ready for review March 9, 2025 11:26
@scordio scordio merged commit 3637119 into main Mar 9, 2025
25 of 27 checks passed
@scordio scordio deleted the gh-3446-module-only-build branch March 9, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme: module system An issue related to the Java module system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop multi-release build in favor of module-only

4 participants