编译器或运行时Install4J属性/变量
问题描述:
作为评估的一部分,将此查询放在此处以防其他人也发现问题并解决问题。编译器或运行时Install4J属性/变量
我的问题是如何在运行maven
构建时将参数从命令行传递给install4jc
编译器,例如,我目前所面对的是这样的:
mvn clean package -Dinstall4j.home=$INSTALL4J_HOME -Dinstall4j.compiler=$INSTALL4J_COMPILER -Dxxxx.install4j.project.file=$XXXXX_INSTALL4J_PROJECT_FILE
但我抛出这个错误:
[INFO] Loading config file
/path/to/installer-file
[INFO] install4j: compilation failed. Reason:
null------------------------------------------------------------------------------
[INFO]
[INFO] The private key is encrypted. To avoid manual intervention, set
the
[INFO] "--mac-keystore-password" command line option or the
[INFO]
"macKeystorePassword" ant task attribute.
[INFO]
------------------------------------------------------------------------------
[INFO]
Enter the password for the macOS key store:
[INFO]
------------------------------------------------------------------------
[INFO]
BUILD FAILURE
我更关心的是通过Maven的传递口令,我知道如何通过他们传递install4jc
命令行使用-D
选项。
是否有compiler.
或runtime.
属性(请参阅https://resources.ej-technologies.com/install4j/help/doc/steps/general/variables.html)可以传递此密码。同样适用于windows keystore password
。
答
您可以对此任务使用Maven配置文件。
假设你想使用的属性“Hokus.Pokus”你可以在你的
~/.m2/settings.xml
定义简介如下:
<profile>
<id>MagicSecret</id>
<properties>
<Hokus.Pokus>Secret</Hokus.Pokus>
</properties>
</profile>
你需要把下节本节
<profiles>
现在,你需要主动此配置文件,当你运行你的项目像
mvn -PMagicSecret clean validate compile package ...
这样,您就可以在您的pom.xml项目中随处使用该属性。
我想你使用的是[sonatype](http://sonatype.github.io/install4j-support/install4j-maven-plugin/plugin-info.html)的maven插件,是吗?您可以在配置部件中预定义maven插件的属性,并通过命令行覆盖属性以用于开发或安全目的,使用'-Dinstall4j.winKeystorePassword = xyz'。 – Hardie82