How do you change the spring-boot dashboard project name in VS Code? - spring-boot

How do you change the spring-boot dashboard project name that shows up in VS Code?
I have tried changing every instance of 'boilerplate-spring' in the project folder including the launch.json configuration file, but when I restart VS Code the same name appears.

With Version: 1.62.3 it's enough to
change the name of the <artifactId> in your project pom.xml
use Clean workspace from the menu ... of the Java Project view
=> The views Java Project and Spring Boot Dashboard shows the new, changed name.

Just:
Change the name of your project name in your pom.xml file. Example: boilerplate-spring to hello-world-spring
Remove your project from VS Workspace: this will remove your project from Spring Boot Dashboard
Add again your project to the VS Workspace: this will add your project to Spring Boot Dashboard with the new name.

Here's work-around that just involves copying the project:
Change all references of the existing project name to the new name. (e.g. boilerplate-spring to my-app-spring in .vscode/launch.json)
With VS Code closed, using windows explorer make a copy your project folder. (e.g. proj to proj-copy)
Open VS Code with the new folder. (e.g. proj-copy)
Wait until the SPRING-BOOT DASHBOARD extension loads the project. It should now have the new name. (e.g. my-app-spring).
Close VS Code.
Delete the previous project folder. (e.g. proj)
Rename the copied folder back to the original name (e.g. proj-copy to proj).
Open VS Code to the original folder. (e.g. proj)

Related

Intellij - adding another SpringBoot project

I have generated two Spring Initializer Maven projects. I open the first one with File-Open-location_of_the_file, It opens up the project, when I want to open the second project it closes the previous project. I want to be able to see both projects in the project window.
I don't want the program to open a second IntelliJ window, I just want them to be inside the same window, same file explorer inside IntelliJ.
I have both projects in the /documents/microservices folder.
I'm relatively new to IntelliJ, help would be greatly appreciated.
Use Import Module action: File | New | Module from Existing Sources.
See Import an existing module documentation for more information.
I solved this issue by doing this:
View -> Tool Windows -> maven -> + "Add maven projects" -> find the pom.xml from the project and then it adds it to your file explorer.

Eclipse 'Project Explorer' doesn't show all the files in the project

I recently migrated from Win 7 to Win 10. I'm using Spring Tool Suite 3 ( Eclipse 2019-06 4.12.0). While on Win 7, I was working on gradle project and was able to view all the project file and build the project successfully. After migrating to Win 10 and importing the project into IDE, doesn't show all the files in the project. I'm able to build the project successfully and able to view all the files in 'Navigator' view as well but in 'Project explorer', some of the files are hidden. I also explored the menu (arrow) button in the project explorer and verified whether 'Filters and Customization' has any settings for hiding the file but there was no filters applied for hiding the files. How to rectify this issue so that I can view entire project structure instead of parking files.
Note - In 'Project Explorer', under particular project I'm able to view drow down arrows but not the actual content.
Looks like this was due to corrupted files in my workspace location i.e. .metadata.plugins\org.eclipse.jdt.core, and a exception was listed in 'Problems' view which said Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$AjcClosure3 cannot be found by org.eclipse.jdt. Fix - I downloaded new STS and created new workspace (make sure inside this, there are no pre-existing .metadata folder) for my project and that fixed the issue.

Visual Studio: Assembly name and Default namespace from project name

Context: setting up the Assembly Name/Default namespace in the Project Properties (right click on project, Properties, Application tab; or edit the .csproj).
I would like to add a parameter there to explicitly have them following the Project Name, plus some custom suffix. So if I rename my project, the Assembly name/namespace follow that rename.
Example: project named foo → foo_suffix.dll. If I rename the project to foo1 → foo1_suffix.dll.
Same behaviour for the namespace.
Reading Common macros for MSBuild commands and properties,
I tried inputting $(ProjectName) both in VS and in the .csproj file, but I get a .dll named exactly like that.
How can I get this done?
How can I get this done?
1. Try using $(MSBuildProjectName) property from this document.
You're developing a C# project(csproj) while your document above is about macros in C++ projects(vcxproj). So I think $(MSBuildProjectName) property can be more suitable for you after my several tests.
(I tried $(ProjectName), but it only worked well when I set something like <AssemblyName>$(ProjectName)</AssemblyName>, if I add a suffix like $(ProjectName)_suffix, the output sometimes is _suffix.dll. But it always work well if I use $(MSBuildProjectName)!)
I get the desired behaviour, but that is inconsistent with what I can
see in project, Properties, Application tab.
2. Try reloading the project file(Right-click project, unload.., reload...) to Update the UI.
From your comment, it seems like the $(ProjectName)_suffix works well in your machine? If so, you can still use $(ProjectName) property.
What you experienced is expected behavior for Msbuild and VS. VS will read value from csproj during project loading process. Then it display the related value by UI.
So after we rename the project name and then build the project, we can get a ProjectName_suffix.dll in output folder. But the UI is still not changed(inconsistent), cause now we need to Update the UI.
You can right-click project node, unload the project=>reload the project to get UI updated. And now the output xx.dll can be consistent with what you see in project, Properties, Application tab. It needs us to reload the project each time after you rename the project, then the UI would be consistent with your xx.dll. And actually it won't affect your build though the UI is not updated, the output can be your desired behaviour.
3. All above is more related to the relationship between Assembly Name and Project Name. One point you should know is msbuild(csproj) won't modify the source files(xx.cs) after the project is created.
So assuming you have a Class1.cs file whose namespace is Library. If you rename the project to NewLibrary, reload the project and you can see the Namespace is NewLibrary now in project, Properties, Application tab. But the namespace for Class1.cs file is still old Library. This is expected behavior in VS, and the new NameSpace NewLibrary would work if you create a new xx.cs file.
Hope all above helps :)

Can't add .tsx files to Node.js Web Application project

I created a new Blank Node.js Web Application in Visual Studio 2015, and I'm unable to add .tsx files to my project and compile them. When I do so, the created .tsx file is put into a Virtual Project instead, even though it is present in the actual project as well. The project is set to compile JSX expressions as React calls.
It took me some time to track down what's happening behind the scenes, and what happens is that when a .tsx file is created in the project (through Add -> New File), it is created as a Content entry in the project's XML file, instead of a TypeScriptCompile entry. This is clearly an error.
I can fix the issue by manually editing the project's XML file, but no way I'm willing to do that for actual production in 2016, with hundreds of files.
Step-by-step guide to reproduce the error
Create a new Blank Node.js Web Application project
Create a new .ts file in the new project
Create a new .tsx file in the new project
See that the displayed "host project" of the .tsx file (check the top-left corner of the editor window) says "TypeScript/JavaScript Virtual Projects".
How can I make it so that .tsx files are included in the project exactly how .ts files are?
Edit
This is not a problem with a HTML Application with TypeScript project, but that project type contains a lot of unnecessary C# bloat that I don't need.
I can fix the issue by manually editing the project's XML file, but no way I'm willing to do that for actual production in 2016, with hundreds of files.
This has to do something with the project template, and is likely a bug. A possible workaround in the meantime is creating the new file as a .ts file, and then renaming it to .tsx.

Change namespace/filesystem folder names in Visual Studio

I'm trying to change a namespace in Visual Studio.
My folder structure looks something like this:
GameAlpha/
GameAlpha.sln
GameAlphaRelease/
GameAlphaTest/
GameAlphaLevelEditor/
These include namespaces like GameAlphaRelease. I want to change all this to GameBetaRelease.
Before this process, it built fine.
First, I changed the solution and project files from Alpha to Beta. Then, I did a "find-replace-all" on the namespace. Finally, I went through the properties of each project and changed the "Assembly Name" and "Default Namespace" to the appropriate Beta title.
However, now the solution does not build. The error is:
GameAlpha.accessor: The reference to 'GameAlpha.exe' was not found in
the list of this projects references.
(Project: GameBetaTest)
What am I doing wrong? If I remove project GameBetaTest, the solution builds just fine.
Also, what is the preferable way to change the names of the folders in the file system?
The following steps normally work for me:
Use the standard project rename (this renames the project, but not the Project Directory). If you want to change the directory as well, close down the solution, rename the directory, open the solution, remove the old project (which is now unavailable) and add the project from the new location.
For each project for which it applies, remove and re-add references to other projects in the solution if there are any inter-project dependencies.
Adjust the project properties for each changed project.
Verify/adjust build scripts.
Verify/adjust the build order.
Clean and rebuild all.
If you do a package/class rename, make sure you do it separately (before, while everything is "still working") so that VS will update the internals as required. YMMV and there are some issues with files "linked" between projects.
Rename the physical project directory
Note: The physical path property is recorded in the .sln file so you cannot just rename the folder in Explorer.
a. Close the solution and the IDE
b. In Explorer: Change the directory name to the new name.
c. In Explorer: Open the .sln file with a text editor.
c. Change the directory name to the new name and save.
d. Restart the IDE and open the solution from the File, Recent Files menu if it doesn't start automatically.
e. Click on the Project folder of the Solution Explorer and check the path property in the properties at the bottom. It will now be referencing to the new project folder.
Here I found it

Resources