This is an automated email from the ASF dual-hosted git repository.

mthmulders pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new fc7e88b  [MGPG-44] gpg:sign fix non-default output directory
fc7e88b is described below

commit fc7e88bdcc0f6f98261e36d232d4edb8e05a7f15
Author: Giovanni <[email protected]>
AuthorDate: Fri Aug 27 23:38:31 2021 +0200

    [MGPG-44] gpg:sign fix non-default output directory
    
    Setting the output directory added an extra unnecessary /target directory.
    Applied a fix for this issue and mostly adding integration tests.
    
    Closes #14
---
 .../maven/plugins/gpg/AbstractGpgSigner.java       |  14 ++-
 .../maven/plugins/gpg/it/GpgSignArtifactIT.java    |  92 ++++++++++++++++
 src/test/resources/it/settings-with-passphrase.xml |  66 +++++++++++
 .../it/sign-release-in-default-dir/pom.xml         | 117 ++++++++++++++++++++
 .../it/sign-release-in-output-dir/pom.xml          | 120 ++++++++++++++++++++
 .../resources/it/sign-release-in-root-dir/pom.xml  | 120 ++++++++++++++++++++
 .../resources/it/sign-release-in-same-dir/pom.xml  | 121 +++++++++++++++++++++
 7 files changed, 645 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/gpg/AbstractGpgSigner.java 
b/src/main/java/org/apache/maven/plugins/gpg/AbstractGpgSigner.java
index 78f50f6..977a575 100644
--- a/src/main/java/org/apache/maven/plugins/gpg/AbstractGpgSigner.java
+++ b/src/main/java/org/apache/maven/plugins/gpg/AbstractGpgSigner.java
@@ -174,14 +174,11 @@ public abstract class AbstractGpgSigner
 
             while ( ( signatureDirectory = signatureDirectory.getParentFile() 
) != null )
             {
-                if ( !signatureDirectory.equals( baseDir ) )
-                {
-                    fileDirectory = signatureDirectory.getName() + 
File.separatorChar + fileDirectory;
-                }
-                else
+                if ( isPossibleRootOfArtifact( signatureDirectory ) )
                 {
                     break;
                 }
+                fileDirectory = signatureDirectory.getName() + 
File.separatorChar + fileDirectory;
             }
             signatureDirectory = new File( outputDir, fileDirectory );
             if ( !signatureDirectory.exists() )
@@ -254,4 +251,11 @@ public abstract class AbstractGpgSigner
     {
         return System.console().readPassword();
     }
+
+    private boolean isPossibleRootOfArtifact( File signatureDirectory )
+    {
+        return signatureDirectory.equals( outputDir )
+                || signatureDirectory.equals( buildDir )
+                || signatureDirectory.equals( baseDir );
+    }
 }
diff --git 
a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java 
b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
new file mode 100644
index 0000000..0cd72de
--- /dev/null
+++ b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
@@ -0,0 +1,92 @@
+package org.apache.maven.plugins.gpg.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.shared.invoker.InvocationRequest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.arrayContainingInAnyOrder;
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.runners.Parameterized.Parameter;
+import static org.junit.runners.Parameterized.Parameters;
+
+@RunWith( Parameterized.class )
+public class GpgSignArtifactIT
+{
+    private final File mavenHome;
+    private final File localRepository;
+    private final File mavenUserSettings;
+    private final File gpgHome;
+
+    public GpgSignArtifactIT() throws Exception
+    {
+        this.mavenHome = new File( System.getProperty( "maven.home" ) );
+        this.localRepository = new File( System.getProperty( 
"localRepositoryPath" ) );
+        this.mavenUserSettings = InvokerTestUtils.getTestResource( 
"/it/settings-with-passphrase.xml" );
+        this.gpgHome = new File( System.getProperty( "gpg.homedir" ) );
+    }
+
+    @Parameters
+    public static Collection<Object[]> data()
+    {
+        return Arrays.asList( new Object[][] {
+                { "/it/sign-release-in-default-dir/pom.xml", 
"/target/gpg/tarballs/",
+                        new String[] { 
"sign-release-in-default-dir-1.0.jar.asc" }},
+                { "/it/sign-release-in-output-dir/pom.xml", 
"/target/signed-files/tarballs/",
+                        new String[] { 
"sign-release-in-output-dir-1.0.jar.asc" }},
+                { "/it/sign-release-in-root-dir/pom.xml", 
"/signed-files/tarballs/",
+                        new String[] { "sign-release-in-root-dir-1.0.jar.asc" 
}},
+                { "/it/sign-release-in-same-dir/pom.xml", "/target/tarballs/",
+                        new String[] { "sign-release-in-same-dir-1.0.jar", 
"sign-release-in-same-dir-1.0.jar.asc" }},
+        } );
+    }
+
+    @Parameter
+    public String pomPath;
+    @Parameter( 1 )
+    public String expectedFileLocation;
+    @Parameter( 2 )
+    public String[] expectedFiles;
+
+    @Test
+    public void testPlacementOfArtifactInOutputDirectory() throws Exception
+    {
+        // given
+        final File pomFile = InvokerTestUtils.getTestResource( pomPath );
+        final InvocationRequest request = InvokerTestUtils.createRequest( 
pomFile, mavenUserSettings, gpgHome );
+        final File integrationTestRootDirectory = new File( 
pomFile.getParent() );
+        final File expectedOutputDirectory = new File( 
integrationTestRootDirectory + expectedFileLocation );
+
+        // when
+        InvokerTestUtils.executeRequest( request, mavenHome, localRepository );
+
+        // then
+        assertThat( expectedOutputDirectory.exists(), equalTo( true ) );
+        assertThat( expectedOutputDirectory.list(), arrayContainingInAnyOrder( 
expectedFiles ) );
+    }
+
+}
diff --git a/src/test/resources/it/settings-with-passphrase.xml 
b/src/test/resources/it/settings-with-passphrase.xml
new file mode 100644
index 0000000..75aa832
--- /dev/null
+++ b/src/test/resources/it/settings-with-passphrase.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0";
+          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";>
+
+    <profiles>
+        <profile>
+            <id>it-repo</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <repositories>
+                <repository>
+                    <id>local.central</id>
+                    <url>file://@settings.localRepository@</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </repository>
+            </repositories>
+            <pluginRepositories>
+                <pluginRepository>
+                    <id>local.central</id>
+                    <url>file://@settings.localRepository@</url>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </pluginRepository>
+            </pluginRepositories>
+        </profile>
+    </profiles>
+
+    <servers>
+        <server>
+            <id>gpg.passphrase</id>
+            <passphrase>TEST</passphrase>
+        </server>
+    </servers>
+
+</settings>
diff --git a/src/test/resources/it/sign-release-in-default-dir/pom.xml 
b/src/test/resources/it/sign-release-in-default-dir/pom.xml
new file mode 100644
index 0000000..da1d947
--- /dev/null
+++ b/src/test/resources/it/sign-release-in-default-dir/pom.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+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.srwopi</groupId>
+    <artifactId>sign-release-in-default-dir</artifactId>
+    <version>1.0</version>
+    <packaging>jar</packaging>
+
+    <description>
+        Tests that signed artifacts are placed in the correct default folder 
structure.
+        Expected path: '/path/to/maven-gpg-plugin/target/gpg/tarballs'
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-gpg-plugin</artifactId>
+                <version>@project.version@</version>
+                <executions>
+                    <execution>
+                        <id>sign-artifacts</id>
+                        <goals>
+                            <goal>sign</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Using assembly plugin to create folder structure -->
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.3.0</version>
+                <configuration>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                    <outputDirectory>target/tarballs</outputDirectory>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.0.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <updateReleaseInfo>true</updateReleaseInfo>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.1</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.0.4</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.3.1</version>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/src/test/resources/it/sign-release-in-output-dir/pom.xml 
b/src/test/resources/it/sign-release-in-output-dir/pom.xml
new file mode 100644
index 0000000..ab51394
--- /dev/null
+++ b/src/test/resources/it/sign-release-in-output-dir/pom.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+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.srwopi</groupId>
+    <artifactId>sign-release-in-output-dir</artifactId>
+    <version>1.0</version>
+    <packaging>jar</packaging>
+
+    <description>
+        Tests that signed artifacts are placed in the correct configured 
folder structure.
+        Expected path: '/path/to/maven-gpg-plugin/target/signed-files/tarballs'
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-gpg-plugin</artifactId>
+                <version>@project.version@</version>
+                <configuration>
+                    <ascDirectory>target/signed-files</ascDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>sign-artifacts</id>
+                        <goals>
+                            <goal>sign</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Using assembly plugin to create folder structure -->
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.3.0</version>
+                <configuration>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                    <outputDirectory>target/tarballs</outputDirectory>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.0.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <updateReleaseInfo>true</updateReleaseInfo>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.1</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.0.4</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.3.1</version>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/src/test/resources/it/sign-release-in-root-dir/pom.xml 
b/src/test/resources/it/sign-release-in-root-dir/pom.xml
new file mode 100644
index 0000000..d4c231c
--- /dev/null
+++ b/src/test/resources/it/sign-release-in-root-dir/pom.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+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.srwopi</groupId>
+    <artifactId>sign-release-in-root-dir</artifactId>
+    <version>1.0</version>
+    <packaging>jar</packaging>
+
+    <description>
+        Tests that signed artifacts are placed in the correct configured 
folder structure.
+        Expected path: '/path/to/maven-gpg-plugin/signed-files/tarballs'
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-gpg-plugin</artifactId>
+                <version>@project.version@</version>
+                <configuration>
+                    <ascDirectory>signed-files</ascDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>sign-artifacts</id>
+                        <goals>
+                            <goal>sign</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Using assembly plugin to create folder structure -->
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.3.0</version>
+                <configuration>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                    <outputDirectory>target/tarballs</outputDirectory>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.0.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <updateReleaseInfo>true</updateReleaseInfo>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.1</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.0.4</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.3.1</version>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/src/test/resources/it/sign-release-in-same-dir/pom.xml 
b/src/test/resources/it/sign-release-in-same-dir/pom.xml
new file mode 100644
index 0000000..77f4c98
--- /dev/null
+++ b/src/test/resources/it/sign-release-in-same-dir/pom.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+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.srwopi</groupId>
+    <artifactId>sign-release-in-same-dir</artifactId>
+    <version>1.0</version>
+    <packaging>jar</packaging>
+
+    <description>
+        Tests that signed artifacts are placed in the correct configured 
folder structure.
+        Expected path: '/path/to/maven-gpg-plugin/target/tarballs'
+        Contains both the original file and the signed file
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-gpg-plugin</artifactId>
+                <version>@project.version@</version>
+                <configuration>
+                    <ascDirectory>target/tarballs</ascDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>sign-artifacts</id>
+                        <goals>
+                            <goal>sign</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- Using assembly plugin to create folder structure -->
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.3.0</version>
+                <configuration>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                    <outputDirectory>target/tarballs</outputDirectory>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.0.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <updateReleaseInfo>true</updateReleaseInfo>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.1</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.0.4</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.3.1</version>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Reply via email to