简体   繁体   中英

Angular + Spring boot Deployment as a war

I have two projects one is Angular Project(Front End Application ) and another one is Spring boot (Rest Api's) .

Now I want to generate a single runnable war/jar file for both these projects and after running "java -jar" command it should up the Angular module as well as spring boot module

On the backend build process, after the frontend module is built, you can copy what's in the frontend build directory into ${project.projectDir}/src/main/resources/static/ so both modules can be packaged into one single jar. Here is an example using Gradle:

task moveFrontendToResources(type: Copy) {
    from "../frontend/build/"
    into "${project.projectDir}/src/main/resources/static/"
}

moveFrontendToResources.dependsOn(':frontend:bundle')
processResources.dependsOn(moveFrontendToResources)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM