maven - 如何将附加参数从 maven build 传递到 npm
问题描述
我有一个连接 maven 版本 3.6、exec-maven-plugin 版本 1.6.0、npm 版本 6.13.4 的问题
我的 pom.xml 文件中的插件定义如下所示
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
<workingDirectory>../my-frontend-app</workingDirectory>
<arguments>
<argument>run</argument>
<argument>build</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
感谢这个插件,我能够在我的 maven 构建期间运行npm run build。
我有问题是使用这个插件将额外的参数传递给我的 npm 构建。我想在 maven 构建期间将应用程序版本从 pom.xml 传递给 my-frontend-app。
任何机构都可以帮助我吗?
解决方案
推荐阅读
- image-processing - 从图像中提取水印
- android - 如何从网站获取安卓应用程序的任何数据
- go - 如何在golang中对固定长度的数组进行排序?
- java - 带有 JSP 的 Spring - 不调用控制器类
- python - 使用 lxml 格式化 xml 脚本
- postgresql - 如何在具有子句的聚合函数旁边选择相应的记录
- javascript - 无法读取未定义的“fn”属性?
- javascript - 使用 onBlur 隐藏表单,但这与提交按钮有冲突
- git - 是否可以从我的 GitHub 个人资料中隐藏某些活动?
- flutter - 颤振有任何与 android spinner 等效的小部件吗?