1
votes

My maven project structure:

My maven project structure

My question is, I need to run only parent module, that automatically instantiate that's sub modules(tomcat server). Is it possible with spring boot multi module project?

Note : I am using STS. parent packaging is pom and child module packaging is jar files.

My Parent pom file

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>com.test</groupId>
<artifactId>test-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>test-parent</name>
<description>testproject for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.7.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
<modules>
    <module>userService</module>
    <module>authenticationService</module>
    <module>dataLayerService</module>
</modules>

My Question is how can I run parent project using tomcat? If I run parent project, child modules are automatically gets run or not?

Thanks in advance !!!

1
please show us pom.xml of your root projectnaXa
By the way, it's not clear what you're askingnaXa
edit your question to include the codenaXa
have edited my questionMegala Perumal
Currently I am started this to run using docker container. Can you provide me the sites for docker-compose file implementation? or explain how to write docker-compose file? Is there any way to run except this docker?Megala Perumal

1 Answers

0
votes

I have configured all the the microservices inside one docker-compose file. using docker-compose up command all modules gets started.(Make one microservice as service and others are child microservice)