【发布时间】:2019-03-12 08:01:39
【问题描述】:
我创建了一个spring boot项目。之后,我在spring boot项目上创建了react项目。现在,前端和后端服务器都在运行。在前端文件夹中,我运行该命令npm run build。
它创建了一个名为 build 的文件夹。我想做的是用一台服务器运行所有项目。(例如:localhost:8080)。我知道我应该将前端文件移动到静态文件夹下。我该怎么做这样做?
我尝试了 maven-antrun-plugin 但它不起作用。
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<configuration>
<target>
<copy todir="${project.build.directory}/classes/public">
<fileset dir="${project.basedir}/frontend/build"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
【问题讨论】:
标签: reactjs spring-boot build