maven - 如何在 maven-resources-plugin 中生成 maven 属性并稍后使用它?
问题描述
在我的项目中,我想生成一个属性(本质上是用户名:密码字符串,base64 编码),然后在执行maven-resources-plugin时使用它。
该属性已正确生成并且在插件外部可见(我已经测试过了):
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>encode-user-pass-base64</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<script language="javascript">
<![CDATA[
...<code here to generate base64data>...
project.setProperty("MAVEN_NPM_AUTH", base64data);
]]>
</script>
</target>
</configuration>
</execution>
</executions>
</plugin>
现在,执行maven-resources-plugin时出现问题:我的资源文件中的所有属性都被正确替换,除了 MAVEN_NPM_AUTH。
知道为什么这个属性没有被替换吗?
解决方案
推荐阅读
- flutter - 为什么不建议在程序文件中解压flutter?
- java - 多线程 Java 应用程序中的 xpathFactory 问题
- node.js - Express API 响应直接在浏览器中输出,而不是由 Nuxt.js 处理
- javascript - 如何提供不变的唯一键来列出 React 中的项目?
- wifi - 如何关闭 Cox Panoramic Wifi 附带的 safebrowsing.io?
- discord.js - 我如何解除公会的每个成员的禁令
- javascript - 通过php向js发送两个变量
- spring-security - 如何避免在 Spring Security 中为非 TokenRelay 页面应用 Token
- javascript - React.js - 待办事项列表编辑按钮不起作用
- c++ - C ++中按值返回与引用的指南?