gpt4 book ai didi

maven-plugin - 在 dockerfile-maven-plugin 的 settings.xml 中使用加密密码

转载 作者:行者123 更新时间:2023-12-04 04:20:51 25 4
gpt4 key购买 nike

我们正在使用来自Spotify的dockerfile-maven-plugin。插件配置如下,settings.xml 片段如下。注意到,如果我们尝试使用在 settings-security.xml 中配置的主密码的加密密码,dockerfile-maven-plugin 会失败。问题是dockerfile-maven-plugin是否允许我们使用加密密码。

<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.3.6</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>host:port/${project.artifactId}</repository>
<tag>${project.version}</tag>
<buildArgs>
<EAR_FILE>${project.build.finalName}.ear</EAR_FILE>
</buildArgs>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
</configuration>
</plugin>

settings-security.xml

<settingsSecurity>
<master>{Ve/ckepqKaIHGVED4WvoUn3htWLfPef158/35o9gdcM=}</master>
</settingsSecurity>

settings.xml

<servers>
<server>
<id>host:port</id>
<username>zenDocker</username>
<password>{rdSNF21NPqMH70L7wKs1ZKg4nWF+8m+Hm3rFrpt/a+g=}</password>
</server>
</servers>

最佳答案

我遇到了同样的问题,我通过使用这个 Maven 扩展解决了它:

<extension>
<groupId>com.github.shyiko.servers-maven-extension</groupId>
<artifactId>servers-maven-extension</artifactId>
<version>1.3.0</version>
</extension>

我使用的引用:https://apexplained.wordpress.com/2015/08/08/password-encryption-in-the-liquibase-maven-plugin/

我的配置结果如下:
settings.xml

<server>
<id>hub.example.com</id>
<username>myUsername</username>
<password>{q6S7TmCyTP0H0q0IGOSsgnHSdbQlwXRcAF6h4Jvh/b0=}</password>
</server>

pom.xml

<build>
<extensions>
<extension>
<groupId>com.github.shyiko.servers-maven-extension</groupId>
<artifactId>servers-maven-extension</artifactId>
<version>1.3.0</version>
</extension>
</extensions>

<plugins>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${com.spotify.dockerfile-maven-plugin.version}</version>
<configuration>
<repository>hub.example.com/${project.artifactId}</repository>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>

关于maven-plugin - 在 dockerfile-maven-plugin 的 settings.xml 中使用加密密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48614768/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com