I created a springboot mutimodule project with the help of tutorial two modules -one backend(java classes), another forntend(angular 5 application) I have included a dependency of frontend module in Backend module. I am creating a jar using maven resource plugin. I am copying static resources to static folder of build directory in my pom.xml too. I also have a @Controller which returns "index". When I run jar I expect to see index.html(of front end module) to render on localhost:8080. But I get an Internal server error saying "template resolver could not find index. I know @Contoller renders an HTML from templates folder, but in my case I want it to be rendered from frontend module.
Here is my pom.xml for frontend module is -
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${build.directory}/classes/static</outputDirectory>
<resources>
<resource>
<directory>target/frontend</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<configuration>
<nodeVersion>v8.10.0</nodeVersion>
<npmVersion>5.6.0</npmVersion>
<workingDirectory>src/main/frontend</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<!-- <resources> -->
<!-- <resource> -->
<!-- <directory>target/frontend</directory> -->
<!-- <targetPath>static</targetPath> -->
<!-- </resource> -->
<!-- </resources> -->
</build>
I am new to springboot, have no idea what I am doing wrong. Please help