【发布时间】:2019-04-03 04:06:50
【问题描述】:
我的 Angular 在 4200 端口上运行,而我的弹簧靴在 8080 端口上运行。在这里,我通过 ng build --prod 构建了 angular 项目,并生成了 dist 文件夹。它们位于 eclipse-workspace 内的同一目录中
我在 pom.xml 文件中添加了插件
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals><goal>copy-resources</goal></goals>
<configuration>
<outputDirectory>${basedir}/target/classes/static/</outputDirectory >
<resources>
<resource>
<directory>${basedir}/../Angular6SpringBoot-Client/dist/Angular6SpringBoot</directory >
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
我已经在 Eclipse 中更新了项目,还清理并构建了项目,当我运行项目时,输出没有出现在 localhost:8080 中,因为它显示:
我需要集成 angular 和 spring 项目并在端口 8080 上运行
【问题讨论】:
-
我写了一个关于它的问答。我认为它可能会对您有所帮助:stackoverflow.com/questions/46913909/…
-
abhishek 至少你有输出我得到 urlmapping not found 错误
标签: java spring angular spring-boot