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 4.0.5 cannot find dependency of fragment #3441
Comments
I have no clue, we changed the way filters are applied to be more generic so maybe the requirement simply don't match the environment, but the setup seems strange here and I did not found any reference to So best chance is provide an integration-test to demonstrate the issue and we can probably take a look here. |
The issue is that Fragment A has a dependency on Fragment B but Tycho doesn't resolve Fragment B because all the package names in Fragment A are the same as Fragment A's host plug-in and it resolves the host plug-in instead of the Fragment. So I've added an As for the |
Actually it is documented:
So I don't know if this is something that Tycho should still support? It did in 4.0.4. |
@Phillipus yes it is documented for pde build and Tycho try to support as much as possible but it seems there is no test for it --> it may break anytime :-\ So if there is demand for that feature a test would be required to make sure
|
I attempted a basic test consisting of two plug-ins and two fragments with one fragment dependent on the other and using the |
- With Tycho 4.0.5 the com.archimatetool.editor.tests fragment is not resolved from com.archimatetool.canvas.tests - See eclipse-tycho/tycho#3441 - Remove the line "extra.. = platform:/fragment/com.archimatetool.editor.tests" from build.properties - Add "Import-Package: com.archimatetool.testingtools" to the com.archimatetool.canvas.tests manifest. This ensures that the com.archimatetool.editor.tests fragment is resolved by forcing it to load
- With Tycho 4.0.5 the com.archimatetool.editor.tests fragment is not resolved from com.archimatetool.canvas.tests - See eclipse-tycho/tycho#3441 - Remove the line "extra.. = platform:/fragment/com.archimatetool.editor.tests" from build.properties - Add "Import-Package: com.archimatetool.testingtools" to the com.archimatetool.canvas.tests manifest. This ensures that the com.archimatetool.editor.tests fragment is resolved by forcing it to load because the package name is unique to that fragment (whereas importing a package that also exists in the fragment's host plug-in will load the host, not the fragment)
Actually Tycho 4.0.5 is resolving the Suppose we have two fragments, <modules>
<module>org.foo.package1</module>
<module>org.foo.package2</module>
</modules> In my own case I just re-arranged the order of modules in the pom and it works again. But surely the order of modules should not matter? |
@Phillipus then it seems we need to make sure it is used as a requirement in the resolving stage, would you mind to create a test that shows the wrong ordering issue? |
I made a simple test with 2 plug-ins, 2 fragments and one pom.xml and I can't reproduce it with that simple example. My real life use case is more complicated with more than one pm, tests, and profiles. |
I've finally created a reproducer, attached. It involves extending a class from a fragment in another class that contains unit tests. There's a Note - the comment above about the order of module declaration doesn't apply to this example. Could someone try the attached project and see if they get the same result, or maybe I missed something? |
I have:
Plugin
com.archimatetool.editor
Plugin
com.archimatetool.canvas
- dependent oncom.archimatetool.editor
Fragment
com.archimatetool.editor.tests
- host iscom.archimatetool.editor
Fragment
com.archimatetool.canvas.tests
- host iscom.archimatetool.canvas
Because some tests in
com.archimatetool.canvas.tests
extend tests incom.archimatetool.editor.tests
there is an additional entry in thecom.archimatetool.canvas.tests
build.properties
file:(I found the advice to do that here)
When I run the tests in the fragments using Tycho 4.0.5 I now get the error "Missing requirement: com.archimatetool.canvas.tests 4.0.0 requires 'org.eclipse.equinox.p2.iu; com.archimatetool.editor.tests 0.0.0' but it could not be found"
This is working with Tycho 4.0.4.
Did anything change in 4.0.5 that might affect how these are being resolved?
The text was updated successfully, but these errors were encountered: