How to make a basic spring boot application? - spring-boot

I am trying to make a basic spring boot application.
Steps I followed - > File - > New -> Spring Starter Project.
I got the below mentioned error by doing so.
What should I do?
This is what the eclipse error log file look like :

Also suggested by #Patrick (this is a community wiki answer):
Spring Test Suite
You should take a look at the proxy settings.
Alternative
You can also open the website yourself:
http://start.spring.io/
Click Generate Project to downloads the project (zipped).

Related

can you help me fix my STS? as it is not working

I am new to STS and trying to run my first project in it. But it is not showing me run on server option. I have tried "clean install" but still, it is not working. When I checked targeted runtimes it is not showing any server in it. Kindly help me to resolve this issue.
My recommendations for getting started with the Spring Tools 4 for Eclipse are:
start the IDE with an empty workspace
create a new Spring Boot project using the wizard "Import Spring Getting Started Content" to import some getting started guides, for example the Rest Service example
if you decide to create an empty new Spring project, use the wizard "Spring Starter Project" - it is the direct integration for https://start.spring.io - and go from there
All those options get you started with a Spring Boot project which doesn't need a separate server to run on. Spring Boot comes with am embedded server component, so you can just start the Spring Boot application as a regular Java app. No need to install a local server or use the "Run on Server" option in the IDE.

Spring Tools 4 for Eclipse info about running app

I am new to Spring and trying to understand a few things. In spring docs read about spring tools and thought to give it a try.
I installed Spring Tools 4.9.0 from Eclipse Marketplace and use it to import a tutorial project (File > New > Other > Import Spring Getting Started Context). Run the app with Boot Dashboard and it works as it should.
Saw in some tutorial videos when the app runs annotations become greenish and if you hover over them you get info like bean id etc.
In my case nothing like that happens. Do i need to configure something in eclipse or am i missing something else?
Thanks in advance.
The feature you are referring to is the "Live Application Information", the user guide section for this is here: https://github.com/spring-projects/sts4/wiki/Live-Application-Information.
In order to have an app showing that live information in the tools, it has to have the spring boot actuators on the classpath: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html.
Depending on the exact guide that you chose it might not have actuators on the classpath out-of-the-box. In that case, add the actuator dependency to your pom.xml file, do a "Maven -> Update Project" from the context menu and start the app again using the dashboard. Then the green live information highlights should appear.

how to write a code for database connection from eclipse using spring. This should be a simple spring maven project without using spring boot

I am new to spring. I am not able to figure out how to write a spring project for creating DB connection using maven , without using spring -boot or hibernate. it is supposed to be a simple spring maven project.
can you help me with few sample codes.
Install the Spring tools suite plugin for eclipse from the following link.
With spring tools suite, access the spring dashboard
Select the Import Reference App, this will provide several example applications from the Spring guides, choose the example and the example will be installed onto your eclipse workspace. These examples are well documented , with clear instructions on how to run the project. Hopefully this should help you get started with learning Spring framework.

Spring Boot 1.2.4.RELEASE cannot generate a simple Startup Project

I am using Spring Boot version 1.2.4.RELEASE to generate a simple web project. The full Url for creating this project is:
http://start.spring.io/starter.zip?name=demo3&groupId=org.test&artifactId=demo3&version=0.0.1-SNAPSHOT&description=Demo+project+for+Spring+Boot&packageName=demo3&type=maven-project&packaging=jar&javaVersion=1.7&language=java&bootVersion=1.2.4.RELEASE&dependencies=web
The download starter project opened in the STS 3.6.4.RELEASE with tons of errors: Missing artifact, ArtifactDescriptorException from the pom.xml file.
However, if I use version 1.1.12.RELEASE of the Spring Boot, I have no problem to create the startup project.
Is this a bug in the 1.2.4.RELEASE of the Spring Boot? I doubt it.
The project is OK.
Please to check your local env, specially connexion, maven configuration (setting.xml), ...etc
Good luck

Spring Tool Suite missing Spring MVC project template

In many examples/tutorials about creating web services using Spring MVC framework are using Spring MVC project template. I can't find it in my project templates list. Am I missing some plugin installed?
for version: 3.7.1
1) Go to File->New
2) Click on Spring Legacy Project
3) Scroll down and select Spring MVC
The templates should be available via a link on the dashboard as shown in the screenshot below. There is no plugin required.
The available templates should be as below:
In New Spring Project form click on "Configure Templates..."
Then in Preference->Spring->Dashboard check Use Old Dashboad
It will be appear
Try this , it solved my issue.
Go to New Project -> Spring Legacy Project. For first use, only show "Simple Project" folder.
Select Configure templates.. (blue link).
In Template Projects window, delete "spring-data-gemfire" and "spring-integration", and check "Show self-hosted templates ..." (at bottom), and then press Apply -> OK
Just wait while refreshing process, and "Spring MVC Project" should be showed.
Go to File -> New
Select Spring Legacy Project
Look for Spring MVC Project under Templates (Last one in the list, Scroll down if needed)
If you don't see the Spring MVC Project, Select Configure templates.. link
Under Preference -> Spring -> Dashboard
Check Use Old Dashboad and press Apply - Ok.
Wait while refreshing process....
You should be able to see Spring MVC Project now.
I had that same problem when i started using sts 3.6.1 version on my laptop. at meanwhile when i choosen spring legacy project folder no spring mvc project folder shown up.but i cofigured my firewall proxy setting and easily got that folder so soon. so before going for mvc first you check urs firewall and proxies.
steps to configure proxies from native to manual to shown spring mvc project:-
window--->preferences--->network connection-->active provider-->choose manual-->ok then go and check spring legacy folder spring mvc will appear

Resources