I am a Java newbie and learning frameworks through the document. I am wondering how can I distinguish which framework is being used? Is it in pom.xml
? or spring.xml
?
If it is, what tags are used?
Thanks!

- 2,329
- 7
- 28
- 51
-
[This](https://stackoverflow.com/questions/32922914/difference-between-spring-mvc-and-spring-boot) other question might help. – Andrew S Sep 30 '19 at 20:46
-
Spring is a container platform. Spring MVC is a set of Web tools that runs inside Spring. Spring Boot is a configuration system to set up a Spring container, and Spring MVC is one of the many components it supports. All Spring Boot applications are also Spring applications, and most are Spring MVC applications. – chrylis -cautiouslyoptimistic- Sep 30 '19 at 21:06
3 Answers
Answering which framework is being used? it's hard to know tbh sometimes
what if is an old app? does it have a pom.xml file? I would ask somethings like
is it a web app? yes does it contain a web.xml? yes check the web.xml maybe there is defined jersey, spring, what version of servlets is uising etc...
does the app has pom.xml? yes review all the dependencies they have
Sometimes I've seen web.xml and pom.xml using many things pffff.
Now speaking just about spring, it's easier if your project uses the annotation:
@SpringBootApplication
It is a SpringBoot app. This annotation should be in the main of the app the class could be named something like XXXXXApplication
and should look like
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class XXXXXApplication {
public static void main(String[] args) {
SpringApplication.run(StackoverflowApplication.class, args);
}
}
there you got it is a SpringBoot app for sure just check the POM.xml and see what starters are example:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
this will add all the dependencies in order to create a controller, service, it will add a run time tomcat etc...
if you want to know more of the starters read here: https://www.javatpoint.com/spring-boot-starters
if you do not see the annotation @SpringBootApplication but it could be using spring, just review the pom file and try to find some spring deendencies or if it is an old app maybe you will see a file called springApplicationContext.xml or beans.xml anyway hope you deal with a SpringBoot app is easier

- 610
- 6
- 11
Visually,you can find out by, if you worked on eclipse and imported or created the Spring boot project in the project explorer itself .. it highlights like
[boot] [devtools] [projectname]
by this way can judge code is spring boot type
other way is to look the Pom.xml the parent dependency.its written like that.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
pom.xml is the answer spring.xml contains spring is used for spring configuration (beans, ...)
Documentation:

- 37
- 1
- 9