Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MGPG-112] serverId def value was unintentionally dropped #80

Merged
merged 2 commits into from Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions pom.xml
Expand Up @@ -274,9 +274,6 @@ under the License.
<goal>clean</goal>
<goal>install</goal>
</goals>
<properties>
<gpg.homedir>${project.build.testOutputDirectory}/gnupg</gpg.homedir>
</properties>
</configuration>
<executions>
<execution>
Expand All @@ -299,6 +296,7 @@ under the License.
<configuration>
<properties>
<gpg.signer>gpg</gpg.signer>
<gpg.homedir>${project.build.testOutputDirectory}/gnupg</gpg.homedir>
</properties>
</configuration>
</execution>
Expand Down
8 changes: 8 additions & 0 deletions src/it/settings.xml
Expand Up @@ -23,4 +23,12 @@ under the License.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<servers>
<server>
<!-- is here only for sign-with-passphase-from-maven-settings IT -->
<id>gpg.passphrase-sign-with-passphase-from-maven-settings</id>
<passphrase>TEST</passphrase>
</server>
</servers>

</settings>
18 changes: 0 additions & 18 deletions src/it/sign-with-passphase-from-maven-settings/invoker.properties

This file was deleted.

4 changes: 3 additions & 1 deletion src/it/sign-with-passphase-from-maven-settings/pom.xml
Expand Up @@ -22,7 +22,7 @@ under the License.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.maven.its.gpg.nma</groupId>
<groupId>org.apache.maven.its.gpg.swpfmc</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
Expand All @@ -48,6 +48,8 @@ under the License.
<version>@project.version@</version>
<configuration>
<!-- load passphrase from settings.xml -->
<!-- but not the default -->
<passphraseServerId>gpg.passphrase-sign-with-passphase-from-maven-settings</passphraseServerId>
</configuration>
<executions>
<execution>
Expand Down
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
var artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0")
var artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/swpfmc/test/1.0")

var expectedFiles = [
"test-1.0.pom",
Expand Down
Expand Up @@ -121,7 +121,7 @@ public abstract class AbstractGpgMojo extends AbstractMojo {
* variables instead.
**/
@Deprecated
@Parameter(property = "gpg.passphrase")
@Parameter(property = GPG_PASSPHRASE)
private String passphrase;

/**
Expand All @@ -134,7 +134,7 @@ public abstract class AbstractGpgMojo extends AbstractMojo {
* variables instead.
**/
@Deprecated
@Parameter(property = "gpg.passphraseServerId")
@Parameter(property = "gpg.passphraseServerId", defaultValue = GPG_PASSPHRASE)
private String passphraseServerId;

/**
Expand Down Expand Up @@ -392,7 +392,7 @@ private boolean isNotBlank(String string) {

@Deprecated
private String loadGpgPassphrase() throws MojoFailureException {
if (isNotBlank(passphrase)) {
if (isNotBlank(passphraseServerId)) {
Server server = settings.getServer(passphraseServerId);
if (server != null) {
if (isNotBlank(server.getPassphrase())) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java
Expand Up @@ -178,6 +178,8 @@ protected void generateSignatureForFile(File file, File signature) throws MojoEx
// Execute the command line
// ----------------------------------------------------------------------------

getLog().debug("CMD: " + cmd);

try {
int exitCode = CommandLineUtils.executeCommandLine(cmd, in, new DefaultConsumer(), new DefaultConsumer());

Expand Down