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

Tycho 2.4.0 Junit classpathcontainer requires Junit 4.13 #1164

Closed
rcspirent opened this issue Jul 19, 2022 · 6 comments
Closed

Tycho 2.4.0 Junit classpathcontainer requires Junit 4.13 #1164

rcspirent opened this issue Jul 19, 2022 · 6 comments
Milestone

Comments

@rcspirent
Copy link

In Tycho 2.4.0 special handling for Junit classpath containers was added.
When using this feature some implicit requirement for Junit 4.13 seems to be added.

[ERROR] Cannot resolve project dependencies: [ERROR] You requested to install 'org.eclipse.equinox.p2.iu; org.junit [4.13.0,5.0.0)' but it could not be found

Reproducable with the following mavvn invocation mvn package -Dtarget-platform=http://download.eclipse.org/eclipse/updates/4.14/ -Dtycho-version='2.4.0' on the integration tests at https://github.com/eclipse/tycho/tree/master/tycho-its/projects/compiler.junitcontainer/junit4-in-bundle

Tested up to Tycho 2.6.0.

@laeubi
Copy link
Member

laeubi commented Jul 19, 2022

This is correct behavior, you need to provide 'org.junit' as part of the build because that is how the JUnit container behaves in Eclipse IDE.

@rcspirent
Copy link
Author

Sorry I wasn't clear enough.
The issue I have is that the eclipse 4.14 repository as in the previous post contains Junit 4.12.
My understanding is that the Junit class path conatiner/4 should be okay with any Junit in the 4.x range.

In short there is Junit 4.12 in the target platform and since Tycho 2.4.0 it still asks for 4.13.

@laeubi
Copy link
Member

laeubi commented Jul 20, 2022

Yes I think that would be okay, do you like to propose a PR?

@sophher
Copy link

sophher commented Dec 16, 2022

Did you resolve the issue or have a workaround? Because I'm facing exactly the same error with Tycho 2.7.5 when building our legacy application with the maven-toolchain-plugin. But I can't downgrade Tycho, because then it's not toolchain aware any more :(

@sophher
Copy link

sophher commented Dec 19, 2022

We found a workaround. We added a newer p2 updatesite, which contains the 4.13 version into our target definition:

<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
  <unit id="org.hamcrest.core" version="0.0.0" />
  <unit id="org.hamcrest.core.source" version="0.0.0" />
  <unit id="org.junit" version="0.0.0" />
  <repository location="https://download.eclipse.org/eclipse/updates/4.16/R-4.16-202006040540" />
</location>

@akurtakov
Copy link
Member

Closing as there is no plan into looking into ancient versions and user found a workaound.

@laeubi laeubi added this to the 4.0 milestone Jun 24, 2023
FJBDev referenced this issue in mytourbook/mytourbook Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants