java - 获取 maven 构建错误:javax.crypto.BadPaddingException:给定最终块在 ~/.m2/settings-security.xml 中未正确填充
问题描述
根据文档,我在 ~/.m2/settings-security.xml 文件中创建/添加了以下代码:
<settingsSecurity>
<master>{ENCRIPTED_PASSWORD}</master>
</settingsSecurity>
使用 maven build(mvn clean package) 后,出现以下错误:
[ERROR] error using security dispatcher: org.sonatype.plexus.components.cipher.PlexusCipherException: javax.crypto.BadPaddingException: Given final block not properly padded
org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException: org.sonatype.plexus.components.cipher.PlexusCipherException: javax.crypto.BadPaddingException: Given final block not properly padded
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.4:sign (sign) on project com.daimler.duke.common.server: error using security dispatcher: org.sonatype.plexus.components.cipher.PlexusCipherException: javax.crypto.BadPaddingException: Given final block not properly padded -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
任何请求都可以帮助我,我现在是 maven 的新手。
谢谢
解决方案
最好重新生成密码。编辑生成的密码可能会损坏它。
下面是生成它的示例命令。请注意在使用 mvn 命令生成密码时在密码周围使用引号。
mvn -emp "<PASSWORD>" and mvn -ep "<PASSWORD>"
推荐阅读
- airflow - 气流警告“将 1 个任务实例设置为 state=None,因为它们关联的 DagRun 未处于 RUNNING 状态”
- reactjs - 将数据从 app.js 传递到 ReactJs 中的组件
- python - Lektor CMS:无法让 lektor-tags 正常工作,在服务器上找不到请求的 URL
- java - 在 Dockerfile 的 ENTRYPOINT 上执行 java 命令无法识别给定的 ARG 值
- spring - 未定义命名查询有问题。我得到 java.lang.IllegalArgumentException: No query defined for that name
- typescript - 包含自身的架构的架构定义
- bash - 比较符号作为变量
- python - 使用类进行减法时如何返回负分数?
- c++ - 条件变量自定义等待函数
- node.js - 用于具有不同角色的用户和配置文件的 MongoDB 方案