-
Notifications
You must be signed in to change notification settings - Fork 116
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
Support specification of remote repositories for Maven-PDE-Targets #202
Comments
Currently m2e only supports one "global" maven context, what would be required to support (pom defined) repositories would be a maven-context per project. Specifying the repository in the file itself would often not enough. e.g. one might want to define mirrors, credentials (encrypted or not), have different profiles, snapshots enabled or not and so on. Some other drawbacks you have already mentioned in your request. That's why currently (user) settings.xml is indeed currently the way to go as otherwise great parts of the maven configuration needs to be replicated. |
Related discussion for Tycho https://bugs.eclipse.org/bugs/show_bug.cgi?id=570611 |
Thanks for your quick answer and sorry for my late response.
Maybe this can be solved step by step and only the most common aspects of specifying other repos are covered first? But for me being able to specify other repos is not urgent. So if you consider this issue in your plans for the maven-target feature it would be great. |
There is one other point that is similar to what mentioned here, we would need to think about how this is to be presented to the user so there should be an UI for add/remove/edit the location (or should we support multiple ones?) as well.
yep this is on my list as well as #212 that essentially will allow to specify more than one dependency per target. Currently there is no funding and/or customer supporting new features in that area so I have to see when/if I can get some free time to push this forward. |
The option to specify the URL for the Maven repository would be great. Maybe the location tag could be enhanced to include an URL? |
That's a good plan. One idea is to have a pruned/miniature pom-editor where one can insert only a While I think this would be a handy approach for experienced maven users, unexperienced users would maybe prefer UI were they can insert the required data step-by-step in separate fields, if possible with drop-down menus and so on. Of course both approaches could be mixed in two different modes, but this would of course lead to more code to create, maintain etc. We could also try to do it similar to the current approach: Have a nice element-wise UI and you can add elements from the clipboard (multiple elements and mixed dependencies and repositories should be supported too). In general I suggest, that we now should try to achieve a complete solution (or at least should have the whole picture in mind) and cover all aspects of Maven dependencies, which are suitable and possible to translate into the Eclipse/PDE world. And I also suggest to stick to the Maven Syntax. Pom's are xml files, a target-platform is a xml-file, so why not nest a
The instructions would then apply to all dependencies of the location element. This way we could also start with a reduced set of supported features and add them later bit by bit, but are not in danger to be blocked in the future because the syntax is already clear. For not supported elements a warning/error could be emitted. As special shortcut and to not break existing target-files, we could keep the current syntax for single dependency elements from default repositories. |
Sounds great @HannesWell. As for the PDE UI in the target editor I think it would be fine to display a "Maven" section in the tree representation of the target editor without the option to edit it and only allow the editing of it in the "Source" tab. |
Maven-PDE-Targets Signed-off-by: Christoph Läubrich <[email protected]>
Thanks! Very useful for clients which needs to control the source of their libraries. |
Fix #202 Support specification of remote repositories for Maven-PDE-Targets
@laeubi thanks a lot! I think it is a good decision to stay close to the Maven syntax. This way all relevant/possible aspects of Maven dependencies can be implemented step by step without the need to re-invent the wheel and at the same time to make it simple to copy snippets from poms directly into the target file. I also like the handling of 'old style' entries. I've already tested it and it works very well. |
At the moment working in the source Tab is IMO only useful, if you know exactly what you are doing. The tooling support is very limited, even though there is some basic support for the standard locations. However this gave me the idea that it would be great if it were as convenient, regarding tooling support, to work in a .target file as for example it is to modify a pom.xml, with content-assist on all levels and documentation for elements and attributes. The tooling support should be designed in a way that it is possible for location-types not maintained by pde (for example, like the This would merge the advantages of the Target-Platform DSL, fast response and fluent work-flow, with those of a regular .target file, works well in the IDE and Tycho and is the 'standard' for Eclipse-PDE and therefore has many extensions like the m2e-Maven type or Oomphs Targlet-Containr. At the same time it would avoid the disadvantages of both. It would avoid the slow Target-Editor for a .target file and the not very fluent work-flow with and it would avoid the additional syntax to maintain of the TP-DSL, which does not support e.g. Maven or targlet targets and has to be converted into a .target file so it can be used during builds. Two files that have to be in sync, can also go out of sync accidentally. But this is probably a bigger task and has to go to PDE. |
IMO, the source tab is the one that provides highest efficiency for a .target that's only made of p2 repositories. The completion in it is more interesting that whatever the wizards show in other pages.
+1, the .target editor is open to such improvements as far as I know.
+1000, the main benefit of the TP-DSL used to be the good textual editor, but I've always advocated it'd be more profitable -and even easier and more sustainable- to improve the existing .target editor to have good edition support than to create a new file.
The textual .target editor uses the Generic Editor. The Generic Editor is extensible. m2e could easily add some completion or hover participants to support Maven location types. |
@HannesWell @vogella Support for this was also added to tycho-snapshot, would be good to test if there are any issues. |
Thanks for this!
The Manifest generated by m2e for the equalsverifier.jar contains this version header: But when I try to run the Maven/Tycho build the target-platform resolution fails with the following error:
This happens regardless if I reference the wrapped bundle using the version This does not happen with the current Tycho 2.4.0 release. So I think the problem is actually in Tycho. |
I have read some of those discussions and I fully agree with you. I just wonder why there are so many complains about that editor but only few/no attempts to improve it.
Thanks for your remarks, that's good to know. Unfortunately I have other topics on my list, that have higher priority for me at the moment. But I will come back to it once they are done (hopefully in autumn/winter of this year) unless somebody else already handled it. |
One point is, that even people complain much, they often refuse to start change something as it is not that bad and simply want to proceed with their daily work. I can only tell from my experience with contributing to PDE (or Eclipse Platform in general) that it is often very hard to even contribute basic features as there are always discussions if the feature is valuable, if there are riks to 'break' users that are used to the old behaviors and so on. So I can fully understand if people decide that's much more profitable to just start from scratch. A good example is the (now at least accepted) maven target platform support:
The only thing making it finally happen was that I'm convinced it will be a great feature and never resigned, but I can totally understand that not everyone is willing / motivated to keep track for a volunteer project > 3 years and as we see here we are still not feature complete with it. The reficio/p2-maven-plugin is the counterpart here (as the TP-DSL is for the target editor) where it was decided to instead spin off a completely new, unconstrained approach and it has 25 (!) contributors, numerous releases dating back to 2013, so one can't argue there is no one willing to contribute for such features per-se.
You should see an output in the log about the resolved items and there version/names maybe this gives a hint? If not at least a tycho-integration test would be good to further investigate, the TargetPlatformLocationsTest would be a good place for this and currently contains already tests for different manifestations of the target features. |
@laeubi would be nice if can get into a faster development and feedback loop in platform and PDE. We already release every 3 months so the release time should not be an issue anymore. One of the issue is that almost nobody reviews incoming changes. If you want I can nominate you as PDE committer to speed up the process. |
@vogella thanks for the offer but I must confess that especially for PDE my last attempts to suggest improvements/new features where very frustrating and I don't expect becoming a committer will change much here... this has essentially made it much unlikely that I'll start a new attempt in the near future beside (for my specific use case) absolute necessary buxfixes. Currently even none of my customers has any focus on improving PDE tooling but are more addicted to switch over to alternative toolings (e.g. BND Tools, InteliJ, ...) so I don't expect much from that side either. |
@laeubi thank you for sharing your insights/experience´. I fully understand that it is frustrating and requires a lot endurance to work an a feature and convince people over such a long time. But I also understand the committers, because if something is not working like before users often start to complain even tough there is an assumed better way because for whatever reason they prefer the old way. So I think OSS in general requires cooperation and patience from all participating parties. And IMHO the fear to break existing code is a big sign of bad test coverage (but likes to write tests?). And I hope/think that improved tooling support for the target editor's source page will be accepted without resistance because it is almost not existing yet, so there is almost no chance to break anything.
Please disregard my remark. It was my fault because, I did something else wrong and everything works fine. |
Great, let me know if you encounter any issues. |
Some PDE reviews are also fast, see for example @laeubi Gerrit from today https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/184053 |
I opened a clarification question for this feature in #488 |
@laeubi I recently had some issues in Eclipse UI to retrieve some Maven dependencies specified in my target platform.
I am sorry if I cannot provide an example for obvious reasons, but maybe there is a clear explanation for this bug in the code. Thanks for reading. |
Specify additional repository in repository is the right choice. The settings used are those in the Preferences > Maven > User Settings so that should be fine, without an runnable example it is hard to guess what might be wrong beside this. As a maven repository is just some http-server serving some files you might be able still create a test-case (e.g. as JUnit) to demonstrate the issue. |
Ok, then I can provide at least an example of the first option mentioned above with a non-login repo. |
I'm not quite sure but you wrote:
So actually it does work when you added the repository but your expectation is that it never works? If the repository is actually queried depends on the state of your local repository, so I'm not sure if I understand the issue correctly.... |
Sorry if it is unclear. |
There is not really a connection between maven.pom and target, thats why you either need:
|
Ok, my bad, I expected my parent POM's <repositories> to be forwarded to the target platform. |
Here is an example for configuring an additional repository in the settings.xml: https://github.com/eclipse-tycho/tycho/wiki#configure-snapshots-repository-globally |
Ok, I got it to work properly, the syntax made me believe that the target platform defined a <repositories> tag itself, whereas it just references an existing one (either in the global settings or in a parent maven.pom file). |
The Maven-Target type is a great feature.
But what is missing at the moment is the possibility to specify any other remote repository than the default maven-central from which Maven artifacts and their dependencies are fetched.
I've seen that this was already discussed in PR #21 where the Maven-Target was added and that at the moment the only way to use another repository is to add it in the Maven-Settings. However this approach is not really feasible because then the Maven settings of every machine that needs to build the project have to be adjusted and kept in sync. Those of my colleagues, the build-server etc.
Therefore I suggest to add a possibility to specify a repository in the target file.
In the mentioned PR you already discussed to bundle the targets per repository but discarded this idea as to complicated. Other approaches could be to allow a nested repository element per Maven-Target (could be cumbersome if multiple artifacts of an remote repository are used) or to allow a Maven-repository element nested directly in the
locations
element or even in thetarget
element. of a .target file.In the latter cases each additionally specified repo could be considered for each maven target. This would also mimic the Maven behavior were you specify a List of repositories and a List of dependencies but (usually) not which dependency comes from which repo. At least I don't know that it would be possible.
The text was updated successfully, but these errors were encountered: