Create both Spring and Spring Boot variants of an application using Maven - spring

Our Existing Parent Project using spring 4.3.3.RELEASE, we are trying provide part of it as a Spring Boot Application and the other parts as a Spring.
To do this it seems we must create a Maven project that has two parents: our existing parent project and the Spring Boot parent. How can we do that?

Split the project into 3 parts, each with a POM. Most of the code goes in a "core" project. The other two are a "spring boot" and a "spring app" projects. Those two have the "core" as a dependency. The differences for Spring Boot and Spring go in those two projects.

Each project can have but one parent POM.

Related

How does Spring Boot 2.3.X Maven Project use Parent POM?

I got to know that Spring Boot 2.3.X is using Gradle.
If so, how does a Maven-based Spring Boot 2.3.X project uses a parent pom?
Spring Boot 2.3 uses Gradle for its own build but applications using Spring Boot can continue to use Maven (or any other build system they were using before). Spring Boot 2.3 publishes the same artifacts (jar files, pom files, etc) as Spring Boot 2.2 so a Maven-based project can continue to use spring-boot-starter-parent as its parent pom.
When you use spring initialiser, you can find the option to build with gradle. All the parent dependencies will be automatically added by the initialiser into the build.gradle file.
Maven based pom.xml shall also be created using same spring initializer by choosing appropriate properties in the initializer page.

Is there any possibility in swagger2 to create a centralized swagger document for two different spring boot projects?

I have two spring boot projects namely A and B. Now, I need to create a centralised swagger document for both A and B projects. Any ways to do it other than with maven multi-modules?
Thanks in advance

Spring Boot web app without maven

Friends,
I am trying to build a Spring boot project. but the challenge is maven isn't working in office environment(basically proxy isn't allowing).
Is there any way to create a spring boot project without maven?
if I can get any boiler code link would be very helpful.
Yes, it is possible. Just add all the necessary jar in project class path manually. Example Spring boot project jar added by gradle.
Part1
Part2

Spring Boot support maven multi-module

I am trying to convert my existing multi-module maven Spring project to Spring Boot project. The reason is make it self contain and follow Martain Fowler's microservices concept.
However, the problem I have encounter is when try to clean build, seems the spring boot is trying to find the Main method from every module, which of course will failed.
Is this feature currently supported by Spring Boot 1.1.6.RELEASE or I did something wrong?
Thanks
It sounds like you've added Spring Boot's Maven plugin to every module in your build – it's what's looking for a main method. You should only add the Spring Boot plugin to a module if its a service that you want to run. If the module's just code that's shared between your services, the Spring Boot plugin isn't needed in that module.

Maven 3 Archetype for Project With Spring, Spring MVC, Hibernate, JPA

I'm trying to use Maven 3 to create a project which uses Spring 3, Spring MVC, Hibernate 4, and JPA. However, when I execute:
mvn archetype:generate
Non of the archetypes listed include all of these; and even those which are close seem to be special projects such as projects with Flex. I want to avoid having extra modules such as Flex that would crowd the project and configuration files. So, is there an archetype for Maven 3 that I can use to create such a project?
A great Spring MVC quickstart archetype is available on GitHub, courtesy of kolorobot. Good instructions are provided on how to install it to your local Maven repo and use it to create a new Spring MVC project. He’s even helpfully included the Tomcat 7 Maven plugin in the archetypical project so that the newly created Spring MVC can be run from the command line without having to manually deploy it to an application server.
Kolorobot’s example application includes the following:
No-xml Spring MVC 3.2 web application for Servlet 3.0 environment
Apache Tiles with configuration in place,
Bootstrap
JPA 2.0 (Hibernate/HSQLDB)
JUnit/Mockito
Spring Security 3.1
Possible duplicate: Is there a maven 2 archetype for spring 3 MVC applications?
That said, I would encourage you to think about making your own archetype. The reason is, no matter what you end up getting from someone else's, you can do better in not that much time, and a decent sized Java project is going to end up making a lot of jar projects.
Take a look at http://start.spring.io/ it basically gives you a kick starter with either maven or gradle build.
Note: This is a Spring Boot based archetype.
With appFuse framework, you can create an Spring MVC archetype with jpa support, etc ...
Take a look at it's quickStart guide to see how to create an archetype based on this Framework.
Foundational frameworks in AppFuse:
Bootstrap and jQuery
Maven, Hibernate, Spring and Spring Security
Java 7, Annotations, JSP 2.1, Servlet 3.0
Web Frameworks: JSF, Struts 2, Spring MVC, Tapestry 5, Wicket
JPA Support
For example to create an appFuse light archetype :
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes
-DarchetypeArtifactId=appfuse-light-struts-archetype -DarchetypeVersion=2.2.1
-DgroupId=com.mycompany -DartifactId=myproject

Resources