使用 Maven 将 Angular 2 个应用程序打包到 JAR 中
Packing Angular 2 app into JAR using Maven
我有一个使用 Angular2 + Webpack 构建的前端应用程序,其结构如下:
> app
> config
> dist
> dll
> node_modules
> src
pom.xml
package.json
... (other files)
我目前正在尝试使用 Maven 将 dist
中应用程序生成的所有内容(css、html、js)打包到 .jar
中。
我的大部分 pom.xml
文件都填满了一些必需的标签,例如许可证、开发人员、scm、groupId、artifactId 等。我目前遇到的问题是什么,我会喜欢一些help with 是 pom.xml
的构建部分,我想应该执行或配置来处理目录等包装细节,但这是我不太确定的,非常感谢任何帮助!
P.S。是否可以为 META-INF/resources/webjars/
切换出 dist
目录?
你需要这样的东西还是我误解你了?
<build>
<resources>
<resource>
<directory>dist</directory>
<targetPath>dist</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
我有一个使用 Angular2 + Webpack 构建的前端应用程序,其结构如下:
> app
> config
> dist
> dll
> node_modules
> src
pom.xml
package.json
... (other files)
我目前正在尝试使用 Maven 将 dist
中应用程序生成的所有内容(css、html、js)打包到 .jar
中。
我的大部分 pom.xml
文件都填满了一些必需的标签,例如许可证、开发人员、scm、groupId、artifactId 等。我目前遇到的问题是什么,我会喜欢一些help with 是 pom.xml
的构建部分,我想应该执行或配置来处理目录等包装细节,但这是我不太确定的,非常感谢任何帮助!
P.S。是否可以为 META-INF/resources/webjars/
切换出 dist
目录?
你需要这样的东西还是我误解你了?
<build>
<resources>
<resource>
<directory>dist</directory>
<targetPath>dist</targetPath>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>