# 배포과정

![](https://94056119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EndMeoMRwmGLpjLCpAE%2Fuploads%2FsOp7p6RoPRgUUjKJ91FF%2Fimage.png?alt=media\&token=ba162d9d-22c4-43d4-904f-0a0ba05692e9)

![](https://94056119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EndMeoMRwmGLpjLCpAE%2Fuploads%2FPeG0f9HobaLdxaQBUmYl%2Fimage.png?alt=media\&token=535b71d8-6a5c-4d4e-992f-f327abf64d1b)

```java
def frontendDir = "$projectDir/frontend"

sourceSets {
   main {
      resources {
         srcDirs = ["$projectDir/src/main/resources"]
      }
   }
}
processResources {
   dependsOn "copyReactBuildFiles"
}
task installReact(type: Exec) {
   workingDir "$frontendDir"
   inputs.dir "$frontendDir"
   group = BasePlugin.BUILD_GROUP
   if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')){
      commandLine "npm.cmd", "audit", "fix"
      commandLine 'npm.cmd', 'install'
   } else {
      commandLine "npm", "audit", "fix" commandLine 'npm', 'install' }
}
task buildReact(type: Exec) {
   dependsOn "installReact"
   workingDir "$frontendDir"
   inputs.dir "$frontendDir"
   group = BasePlugin.BUILD_GROUP
   if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
      commandLine "npm.cmd", "run-script", "build"
   }
   else {
      commandLine "npm", "run-script", "build"
   }
}
task copyReactBuildFiles(type: Copy) {
   dependsOn "buildReact"
   from "$frontendDir/build"
   into "$projectDir/src/main/resources/static"
}
```

![](https://94056119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EndMeoMRwmGLpjLCpAE%2Fuploads%2Fo65vMJwH6vVvTuCeIRYP%2Fimage.png?alt=media\&token=1f508d78-0790-4b21-a8c7-4fa0f03b4a79)

![](https://94056119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EndMeoMRwmGLpjLCpAE%2Fuploads%2FCa1K4Fjn4eagPSkfMCAx%2Fimage.png?alt=media\&token=3dc8ec6d-620a-4ca9-9cf8-c0152f8da86d)



![](https://94056119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EndMeoMRwmGLpjLCpAE%2Fuploads%2FWM5q9r7GmqDX4PKLgcfv%2Fimage.png?alt=media\&token=c3506fc7-ac0e-419f-acb8-6dabc715a1a7)
