Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUREFIRE-2179] Support adding additional Maven dependencies to the test runtime classpath #667

Merged
merged 8 commits into from
Jun 30, 2023

Conversation

kwin
Copy link
Member

@kwin kwin commented Jun 23, 2023

No description provided.

@kwin kwin force-pushed the feature/additional-classpath-via-maven-gav branch 2 times, most recently from b4ae9f0 to 7fdd4ef Compare June 23, 2023 12:26
@michael-o michael-o removed their request for review June 23, 2023 14:10
@kwin kwin force-pushed the feature/additional-classpath-via-maven-gav branch 2 times, most recently from c1ac74b to 764cc7f Compare June 26, 2023 16:15
@kwin kwin changed the title [SUREFIRE-2179] Support adding additional Maven artifacts to the test classpath [SUREFIRE-2179] Support adding additional Maven dependencies to the test classpath Jun 26, 2023
@kwin kwin requested a review from cstamas June 26, 2023 16:17
@kwin kwin force-pushed the feature/additional-classpath-via-maven-gav branch from 764cc7f to 238a1f9 Compare June 26, 2023 16:24
@kwin kwin force-pushed the feature/additional-classpath-via-maven-gav branch from 238a1f9 to 9ebe4ae Compare June 26, 2023 16:25
Copy link
Member

@slawekjaranowski slawekjaranowski left a comment

Choose a reason for hiding this comment

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

An integration test will be appreciated for such feature.

@olamy
Copy link
Member

olamy commented Jun 27, 2023

is it possible to have an IT test? as I cannot see any test here. thanks

@kwin
Copy link
Member Author

kwin commented Jun 29, 2023

is it possible to have an IT test? as I cannot see any test here. thanks

Done now, you find it in https://github.com/apache/maven-surefire/pull/667/files#diff-311598b970ad59d912704889726abb7abbf6d92d3d5382a94d85c8c686ab24b9R21

@cstamas
Copy link
Member

cstamas commented Jun 29, 2023

For all non POM/dependency and POM/plugins/plugin/dependency elements, especially for plugin config like this one (or like compiler anno processor is, etc) we MUST BE CLEAR that it works ONLY for external dependencies. These elements do NOT participate in project topological sorting, hence, becomes impossible to use some reactor project for these (without hacks). Moreover, if using reactor artifacts, this is one of the reasons why users are forced to to mvn install as 1st pass, and from 2nd pass onward "it will work", but again, what is being used "lags" one build cycle (as installed thing is being used, not the currently built one).

See for example here https://issues.apache.org/jira/browse/MNG-6877

@cstamas
Copy link
Member

cstamas commented Jun 29, 2023

In fact, IMHO we should revisit ALL these plugins having "artifact-like" (GAV) parameters and using resolver to resolve them, and

  • mark all these configurations as "usable for out-of-reactor artifacts only" (or, be very clear that it is user who needs to hack in proper build order by whatever means he can)
  • or come up with some proper solution in Maven to make sorting aware of ALL these

Biggest problem with parameters like this is when using in-reactor artifact, "by chance" the ordering may be good, and seemingly everything works, but then user changes something completely unrelated (ie. adds a new module to build), that changes build order, and suddenly this breaks. In this situations is hard to figure out why breakage happened.

@kwin kwin changed the title [SUREFIRE-2179] Support adding additional Maven dependencies to the test classpath [SUREFIRE-2179] Support adding additional Maven dependencies to the test runtime classpath Jun 29, 2023
@kwin kwin merged commit 47eb197 into master Jun 30, 2023
@michael-o michael-o deleted the feature/additional-classpath-via-maven-gav branch July 6, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants