BAEL-9709 Fix start of Boot projects with parent-boot-2 parent

-Added placeholder {start-class} tag in parent-boot-2's spring-boot-maven-plugin so that any child that has a {start-class} automatically is benefited from this plugin and wil help that child class to run
-Fix startup issues of few spring boot 2 projects
This commit is contained in:
Dhawal Kapil 2018-10-26 23:56:07 +05:30
parent 1bca2a8c54
commit 8c361330f1
6 changed files with 36 additions and 23 deletions

View File

@ -42,6 +42,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>${start-class}</mainClass>
</configuration>
</plugin>
</plugins>
</pluginManagement>

View File

@ -1,7 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId>
<artifactId>spring-all</artifactId>
<version>0.1-SNAPSHOT</version>
<name>spring-all</name>

View File

@ -23,7 +23,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- The main class to start by executing java -jar -->
<start-class>com.mycorp.starter.HelloWorldApplication</start-class>
<start-class>com.baeldung.h2db.demo.server.SpringBootApp</start-class>
</properties>
<dependencies>

View File

@ -8,11 +8,11 @@
<description>Module For Spring Boot MVC</description>
<parent>
<artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent>
<artifactId>parent-boot-2</artifactId>
<groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent>
<dependencies>
<dependency>
@ -23,7 +23,7 @@
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<!--JSF-->
<!--JSF -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
@ -35,18 +35,27 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- ROME for RSS -->
<!-- ROME for RSS -->
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
<version>${rome.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
</dependencies>
<build>
@ -55,17 +64,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.baeldung.springbootmvc.SpringBootMvcApplication</mainClass>
<layout>JAR</layout>
</configuration>
<mainClass>com.baeldung.springbootmvc.SpringBootMvcApplication</mainClass>
<layout>JAR</layout>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<!-- ROME for RSS -->
<rome.version>1.10.0</rome.version>
<start-class>com.baeldung.springbootmvc.SpringBootMvcApplication</start-class>
</properties>
<properties>
<!-- ROME for RSS -->
<rome.version>1.10.0</rome.version>
<start-class>com.baeldung.springbootmvc.SpringBootMvcApplication</start-class>
</properties>
</project>

View File

@ -1,9 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId>
<artifactId>spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-boot</name>
<description>This is simple boot application for Spring boot actuator test</description>
@ -159,6 +157,11 @@
<version>1.1.16</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
</dependencies>
<build>
@ -234,7 +237,6 @@
<graphql-spring-boot-starter.version>3.6.0</graphql-spring-boot-starter.version>
<graphql-java-tools.version>3.2.0</graphql-java-tools.version>
<guava.version>18.0</guava.version>
<junit-platform.version>1.2.0</junit-platform.version>
<git-commit-id-plugin.version>2.2.4</git-commit-id-plugin.version>
</properties>

View File

@ -220,7 +220,7 @@
<properties>
<start-class>org.baeldung.Application</start-class>
<start-class>org.baeldung.custom.Application</start-class>
<!--If you want to run the example with the voters comment the tag
above and uncomment the one below -->
<!--<start-class>org.baeldung.voter.VoterApplication</start-class> -->