-
Notifications
You must be signed in to change notification settings - Fork 208
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 for creating Spring XML config files #1163
Comments
Thanks @sanketcs30 for reaching out to us with this request. The STS 3.x plugins for Eclipse are no longer maintained and especially due to the continuous evolution of the underlying Eclipse platform, the old versions of the STS 3.x plugins for Eclipse don't work anymore with the latest Eclipse versions. We are encouraging the transition to the Spring Tools 4 for Eclipse and VSCode since a number of years now and your projects that use Spring XML configurations should still work fine with using Spring Tools 4. The piece that I would like to understand in more depth here is what exactly are you missing in the Spring Tools 4? Can you describe those features in more detail and maybe provide sample projects to illustrate those? There is basic support for working with Spring XML configuration files in Spring Tools 4, like content-assist for bean refs, class names, etc. So what exactly is not (yet) working, what features are you missing the most? |
Acutally STS 4 is not having options to create spring bean file , adding namespaces for different spring modules like spring core , aop , mvc , transaction which were available in STS 3 plugin |
Let me try to summarize: Support for cresting new Spring XML configuration files with an easy way to select the Spring XML namespaces based on the libraries on the classpath of the project. What about adding additional Spring XML namespaces to existing Spring XML config files? Is this something you would need as well? Or do you mostly select those namespaces when creating Spring XML config files? |
(I updated the title if this issue accordingly) |
Yes @martinlippert Support for cresting new Spring XML configuration files with an easy way to select the Spring XML namespaces based on the libraries on the classpath of the project , it is not available in STS 4 , like in STS 3 plugin when we use following steps Like the image showing namespaces tab How can we get these options in STS 4 , so it will be helpful if these features of STS 3 are added in STS 4 plugin |
Hi @martinlippert , may I ask how to work with Spring XML configuration files in Spring Tools 4? I can't find this option from the pure latest version of STS4 (4-4.21.0.RELEASE) with no plugin. |
Hi @nealwei2008 @martinlippert , yes in STS 4 we get option to create spring starter project , but option is not available for spring which was available in STS 3 version , under spring folder in wizards we were able to create spring bean configuration file along with adding namespaces for different spring modules which was helpful if someone is working with XML based spring projects Below are some of the screenshots which shows how STS 3 plugin was providing options related to spring bean configuration file 1. Creating spring bean configuration file through wizard 2. Once spring bean configuration file is created , it used to give option to add namespaces So, these are the options that are missing in new STS 4 which I think useful if someone is working with XML based spring projects , because each time manually creating spring bean configuration file and adding namespaces is not a good option |
Thanks @sanketcs30 for your answer, I knew the options about STS 3 and I just want to fix the xml error just like the element 'beans' in STS 4 with "cvc-elt.1.a: Cannot find the declaration of element 'beans'." |
Thanks @nealwei2008 for your answer , I have gone through your mentioned steps , yes even after applying those steps like window -> Preferences -> Spring -> XML Config Files -> Enable Spring XML Config files support , I am not able to see any spring folder in the wizards , so how can we find that is my question , if anyone is having any idea regarding this then please reply , it will be helpful And @nealwei2008 for your error , I have found some solution in the link mentioned below |
Let me provide some clarify around the Spring XML support that we have in the Spring Tools 4... :-) Spring Tools 4 provides enhanced content-assist for Spring XML config files if you open them in an XML editor in Eclipse or VSCode, for example for Spring references or class names (to name a few). This is what you enable with the mentioned preference at (the preference mentioned in #1163 (comment) is referring to an old structure of the preferences) There is no wizard to create new Spring XML config files anymore in the Spring Tools 4. You would have to create a simple plain new XML file (in the same way you would create any other new file in your project). That also means that the Spring Tools 4 don't have the wizards mentioned in #1163 (comment) anymore that allow you to visually select namespaces to be included. Since we moved the overall tooling to a new architecture, we will most likely not bring back the old wizards for creating Spring XML config files. Instead, we could think about other ways to support you with the tasks that are mentioned here:
Most of this would probably happen inside of the editor itself using content-assist and code actions, e.g. when you create a new XML file, it could be pre-filled with some Spring XML config file body blurb and giving you the option to select the namespaces via some content-assist actions directly in the editor. Just an initial idea, but I would like to think in this direction in case we re-introduce support for that in the Spring Tools 4. Happy to work with you on some initial thoughts and implementations, get feedback, and work on a few incremental steps here. |
Yes @martinlippert. That would be great if it can be achieved. Compared to building from scratch, there are also a considerable number of historical projects. At the same time, many newcomers learn about previous construction methods such as XML Config, which is very helpful for them to master new methods.
These are enough for me and I think they should be enough for projects that have not yet been fully upgraded but are only for temporary use. |
Thanks @martinlippert @nealwei2008 for your support and brief answers. Yes , if STS 4 will include the following things , then it will be great in case of working with legacy projects with XML configuration files |
…content-assist in empty XML file
Here is the new editor-centric support for creating Spring XML config files and adding namespaces to it. The list of namespace suggestions is not (yet) based on the exact Spring modules on the classpath of the project, but just a static list of the namespaces from the core Spring framework project. xml-content-assist-demo.movPlease note that the Spring framework intend to phase out XML bean definitions and in particular XML configuration namespaces (as mentioned here: spring-projects/spring-framework#24237 (comment)), so we will most likely not add a lot of additional tooling features in this space anymore. But if there is something that you are missing a lot when working with existing Spring XML config files in your existing projects, let us know and we can see on a case-by-case base what is possible to implement for future versions. |
Hi @martinlippert can you please mention steps for how to create that spring-config.xml file , as I'm trying to work with the STS 4.21.0 version , there is no option of creating that xml file like previously we used to create like File -> New -> Other -> Spring configuration file |
This will come as part of the |
Hi @martinlippert , as you have mentioned in last post I have installed STS 4.21.1 version and tried to create spring bean configuration file , but I was unable to find the option to add namespaces or spring XML config file skeleton option as you have mentioned in the last post , can u please help me with how to get spring XML config file skeleton option or is there any way to add that option Options that are showing in XML file are:- |
Please make sure that you have enabled the Spring XML config file support in the |
@batobolg This looks like a different problem (showing an error when content-assist should show up for types), so please open a separate issue for this. It would also be good if you could open the Error Log view and and paste the details for the error message here, so that we can get a better understanding of that is wrong here. It might also be useful if you could enable the logging of the language server process ( Thanks! |
Hi @martinlippert , I'm trying to install STS 3.9.14 plugin in Eclipse IDE , then it's giving multiple errors and I have resolved these by installing new STS 4 plugin , but the main purpose of using 3.9.14 version STS plugin is to work with spring based projects with XML configurations , there is need of using spring bean configuration file , namespaces which is not available in STS 4 plugin , so is Spring team planning for the same spring IDE support in STS 4 also , it will be really helpful as many spring based legacy projects are still going in XML and Java based configurations
Thanks
#STS 4 issue #Support for Spring IDE features @martinlippert
The text was updated successfully, but these errors were encountered: