Introduce mock repository manager to verify uploaded artifacts
diff --git a/.gitignore b/.gitignore
index e02456b..8614d5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
 target/
 .idea
 *.iml
+/.classpath
+/.project
+/.settings/
diff --git a/pom.xml b/pom.xml
index 923668a..6508132 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,9 +158,38 @@
               <debug>false</debug>
               <showErrors>true</showErrors>
               <showVersion>true</showVersion>
-              <streamLogs>true</streamLogs>
+              <goals>
+                <goal>deploy</goal>
+              </goals>
+              <projectsDirectory>src/it/projects</projectsDirectory>
+              <settingsFile>src/it/mrm/settings.xml</settingsFile>
+              <filterProperties>
+                <mrm.distribution.url>${mrm.distribution.url}</mrm.distribution.url>
+              </filterProperties>
             </configuration>
           </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>mrm-maven-plugin</artifactId>
+            <version>1.2.0</version>
+            <executions>
+              <execution>
+                <id>distribution</id>
+                <goals>
+                  <goal>start</goal>
+                  <goal>stop</goal>
+                </goals>
+                    <configuration>
+                      <propertyName>mrm.distribution.url</propertyName>
+                      <repositories>
+                        <hostedRepo>
+                          <target>target/hosted-repo</target>
+                        </hostedRepo>
+                      </repositories>
+                    </configuration>
+              </execution>
+            </executions>
+          </plugin>
         </plugins>
       </build>
     </profile>
diff --git a/src/it/big-artifact/invoker.properties b/src/it/big-artifact/invoker.properties
deleted file mode 100644
index a9f0e93..0000000
--- a/src/it/big-artifact/invoker.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# 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.
-#
-
-invoker.goals = install --no-transfer-progress -Drevision=1.1.1-SNAPSHOT
-
-invoker.mavenOpts = -Dorg.slf4j.simpleLogger.showDateTime=true
-
diff --git a/src/it/settings.xml b/src/it/mrm/settings.xml
similarity index 100%
rename from src/it/settings.xml
rename to src/it/mrm/settings.xml
diff --git a/src/it/pom-packaging/invoker.properties b/src/it/pom-packaging/invoker.properties
deleted file mode 100644
index 1113391..0000000
--- a/src/it/pom-packaging/invoker.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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.
-#
-
-invoker.goals = install --no-transfer-progress -Drevision=1.1.1-SNAPSHOT
-
diff --git a/src/it/big-artifact/pom.xml b/src/it/projects/big-artifact/pom.xml
similarity index 93%
rename from src/it/big-artifact/pom.xml
rename to src/it/projects/big-artifact/pom.xml
index 5b74862..1107d52 100644
--- a/src/it/big-artifact/pom.xml
+++ b/src/it/projects/big-artifact/pom.xml
@@ -26,8 +26,15 @@
 
   <groupId>test-group</groupId>
   <artifactId>big-artifact</artifactId>
-  <version>${revision}</version>
+  <version>1.0.0</version>
   <packaging>pom</packaging>
+  
+  <distributionManagement>
+    <repository>
+      <id>mrm</id>
+      <url>@mrm.distribution.url@</url>
+    </repository>
+  </distributionManagement>
 
   <build>
     <extensions>
diff --git a/src/it/big-artifact/setup.groovy b/src/it/projects/big-artifact/setup.groovy
similarity index 100%
rename from src/it/big-artifact/setup.groovy
rename to src/it/projects/big-artifact/setup.groovy
diff --git a/src/it/projects/big-artifact/verify.groovy b/src/it/projects/big-artifact/verify.groovy
new file mode 100644
index 0000000..2fd8b6a
--- /dev/null
+++ b/src/it/projects/big-artifact/verify.groovy
@@ -0,0 +1,32 @@
+import java.security.SecureRandom
+
+/*
+ * 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.
+ *
+ */
+def remoteRepo = new File(basedir, '../../hosted-repo')
+
+def gavFolder = new File(remoteRepo, 'test-group/big-artifact/1.0.0')
+
+def expectedSignedFiles = ['big-artifact-1.0.0.pom.asc',
+ 		 				   'big-artifact-1.0.0.dat.asc'] as Set
+					 
+def deployedSignedFiles = [] as Set
+gavFolder.eachFileMatch(groovy.io.FileType.FILES, ~/big-artifact-1\.0\.0.+\.asc/) { deployedSignedFiles << it.name } 
+
+assert deployedSignedFiles== expectedSignedFiles
diff --git a/src/it/pom-packaging/pom.xml b/src/it/projects/pom-packaging/pom.xml
similarity index 91%
rename from src/it/pom-packaging/pom.xml
rename to src/it/projects/pom-packaging/pom.xml
index 59a7df3..88b7bfd 100644
--- a/src/it/pom-packaging/pom.xml
+++ b/src/it/projects/pom-packaging/pom.xml
@@ -26,8 +26,15 @@
 
   <groupId>test-group</groupId>
   <artifactId>pom-packaging</artifactId>
-  <version>${revision}</version>
+  <version>1.0.0</version>
   <packaging>pom</packaging>
+  
+  <distributionManagement>
+    <repository>
+      <id>mrm</id>
+      <url>@mrm.distribution.url@</url>
+    </repository>
+  </distributionManagement>
 
   <build>
     <plugins>
diff --git a/src/it/projects/pom-packaging/verify.groovy b/src/it/projects/pom-packaging/verify.groovy
new file mode 100644
index 0000000..46df6fb
--- /dev/null
+++ b/src/it/projects/pom-packaging/verify.groovy
@@ -0,0 +1,31 @@
+import java.security.SecureRandom
+
+/*
+ * 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.
+ *
+ */
+def remoteRepo = new File(basedir, '../../hosted-repo')
+
+def gavFolder = new File(remoteRepo, 'test-group/pom-packaging/1.0.0')
+
+def expectedSignedFiles = ['pom-packaging-1.0.0.pom.asc'] as Set
+					 
+def deployedSignedFiles = [] as Set
+gavFolder.eachFileMatch(groovy.io.FileType.FILES, ~/pom-packaging-1\.0\.0.+\.asc/) { deployedSignedFiles << it.name } 
+
+assert deployedSignedFiles== expectedSignedFiles
diff --git a/src/it/standard-packaging/pom.xml b/src/it/projects/standard-packaging/pom.xml
similarity index 93%
rename from src/it/standard-packaging/pom.xml
rename to src/it/projects/standard-packaging/pom.xml
index 8fe32c0..a998a46 100644
--- a/src/it/standard-packaging/pom.xml
+++ b/src/it/projects/standard-packaging/pom.xml
@@ -26,11 +26,17 @@
 
   <groupId>test-group</groupId>
   <artifactId>standard-packaging</artifactId>
-  <version>${revision}</version>
+  <version>1.0.0</version>
 
+  <distributionManagement>
+    <repository>
+      <id>mrm</id>
+      <url>@mrm.distribution.url@</url>
+    </repository>
+  </distributionManagement>
+  
   <build>
     <plugins>
-
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
diff --git a/src/it/standard-packaging/test.dat b/src/it/projects/standard-packaging/test.dat
similarity index 100%
rename from src/it/standard-packaging/test.dat
rename to src/it/projects/standard-packaging/test.dat
diff --git a/src/it/projects/standard-packaging/verify.groovy b/src/it/projects/standard-packaging/verify.groovy
new file mode 100644
index 0000000..e8d8cbd
--- /dev/null
+++ b/src/it/projects/standard-packaging/verify.groovy
@@ -0,0 +1,34 @@
+import java.security.SecureRandom
+
+/*
+ * 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.
+ *
+ */
+def remoteRepo = new File(basedir, '../../hosted-repo')
+
+def gavFolder = new File(remoteRepo, 'test-group/standard-packaging/1.0.0')
+
+def expectedSignedFiles = ['standard-packaging-1.0.0.pom.asc',
+ 		 				   'standard-packaging-1.0.0.jar.asc',
+ 		 				   'standard-packaging-1.0.0.dat.asc',
+ 		 				   'standard-packaging-1.0.0-c1.dat.asc'] as Set
+					 
+def deployedSignedFiles = [] as Set
+gavFolder.eachFileMatch(groovy.io.FileType.FILES, ~/standard-packaging-1\.0\.0.+\.asc/) { deployedSignedFiles << it.name } 
+
+assert deployedSignedFiles== expectedSignedFiles
diff --git a/src/it/standard-packaging/invoker.properties b/src/it/standard-packaging/invoker.properties
deleted file mode 100644
index 1113391..0000000
--- a/src/it/standard-packaging/invoker.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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.
-#
-
-invoker.goals = install --no-transfer-progress -Drevision=1.1.1-SNAPSHOT
-