spring boot – Publish my project (SpringBoot + Angular 7)

spring boot – Publish my project (SpringBoot + Angular 7)

First thing first, add your Angular dist folder in your jar while building. Add below plugin in plugins. Change path/to/dist/folder to your dist directory e.g. C:angulardemongdistdemong

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-resources</id>
            <phase>validate</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${project.build.directory}/classes/static</outputDirectory>
                <resources>
                    <resource>
                        <directory>path/to/dist/folder</directory>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

After this, your dist folder should be encapsulated in jar.

spring boot – Publish my project (SpringBoot + Angular 7)

Leave a Reply

Your email address will not be published. Required fields are marked *