-
Notifications
You must be signed in to change notification settings - Fork 191
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
issue #697 reproducer #827
Conversation
@pzi-dsa well done in reproduce the issue, I think the problem is the following log-output:
This is most probably because we add maven dependencies to the pom model and then maven resolves it already there. Then when the target retries it might has already failed the attempt and did not try again with the different repositories (probably a bug in maven). |
I agree, it seems like the problem only appears, whenever dependencies are resolved via Maven. I assume the problem only appeared with 2.7.0 because of the addition of Maven metadata to be bundled artifacts. Since then Maven is used directly, in favor of Tycho.
I noticed that the nexus repository is not included in the brackets. Instead it looks like Maven only uses central, default and releases to find the artifact. Is Maven aware of the repositories specified in the target platform definition? During separate tests, I replaced the URL in either the central, default or releases repository with the one from the nexus repository. In all cases, Tycho/Maven was then able to find all required dependencies. My guess is that either the resolver instance used by Maven is created before Tycho adds the repositories from the target platform to it and is then not properly updated, or the repositories aren't added to begin with. Edit: I think I misread the debug message. default and release are not separate repositories. Nevertheless, even with unrelated ids, the build still succeeds. |
No because target platform resolution has nothing to do with maven resolution, even though both use the same resolver! |
Okay what happens here is the following: The target is resolved and there everything works fine, but maven records the repository that was used to resolve the artifact:
Then we add this to the maven model as a regular dependency and maven tries resolve this as well. Because the repository is not configured, maven think something has changed and do an update with maven central, where it is not found. So what would work is to configure all repositories as well for maven as for the target, but that's kind of undesirable... There are some ways to handle this, but I'm not sure each has some drawbacks:
|
@pzi-dsa thanks for the reproducer, I have merged this and fixed it with #855 |
The test case attempts to build two plugins with dependencies from an external (Nexus) repository.
The first plugin depends on a Maven artifact which is rebundled and builds successfully.
The second plugin depends on an OSGi bundle which can't be resolved during the build.
The issue has been introduced with Tycho 2.7.0.