ensure ResolveDependenciesLifecycleParticipant was executed

git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1597184 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/it/reactor/invoker.properties b/src/it/reactor/invoker.properties
index 73ed836..d5d6ca5 100644
--- a/src/it/reactor/invoker.properties
+++ b/src/it/reactor/invoker.properties
@@ -15,4 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-invoker.goals = clean install
+invoker.goals = install
diff --git a/src/it/reactor/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java b/src/it/reactor/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java
index 99c3c15..dbd536a 100644
--- a/src/it/reactor/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java
+++ b/src/it/reactor/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java
@@ -29,6 +29,8 @@
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.Logger;
 
+import java.io.File;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -55,27 +57,36 @@
     @Override
     public void afterProjectsRead( MavenSession session ) throws MavenExecutionException
     {
-        log.debug( "" );
+        log.info( "" );
         log.info( "ResolveDependenciesLifecycleParticipant#afterProjectsRead" );
-        log.debug( "" );
 
         final List<MavenProject> projects = session.getProjects();
+        File basedir = new File( session.getExecutionRootDirectory() );
 
         for ( MavenProject project : projects )
         {
-            log.debug( "" );
-            log.debug( "project=" + project.getArtifact() );
+            log.info( "building dependency graph for project " + project.getArtifact() );
 
+            File resolved = new File( basedir, "resolved-" + project.getArtifactId() + ".txt" );
             try
             {
                 // No need to filter our search. We want to resolve all artifacts.
                 dependencyGraphBuilder.buildDependencyGraph( project, null, projects );
+
+                // proof that resolution has happened
+                resolved.createNewFile();
             }
             catch ( DependencyGraphBuilderException e )
             {
-                throw new MavenExecutionException( "Could not resolve dependencies for project : " + project, e );
+                throw new MavenExecutionException( "Could not resolve dependencies for project: " + project, e );
+            }
+            catch ( IOException e )
+            {
+                throw new MavenExecutionException( "Could not create " + resolved, e );
             }
         }
+
+        log.info( "" );
     }
 }
   
diff --git a/src/it/reactor/setup.bsh b/src/it/reactor/setup.bsh
new file mode 100644
index 0000000..fe4ec74
--- /dev/null
+++ b/src/it/reactor/setup.bsh
@@ -0,0 +1,31 @@
+/*
+ * 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 java.io.*;
+
+import org.codehaus.plexus.util.*;
+
+files = FileUtils.getFiles( basedir, "resolved-*.txt", "" ).iterator();
+
+while ( files.hasNext() )
+{
+  files.next().delete();
+}
+
+return true;
diff --git a/src/it/reactor/verify.bsh b/src/it/reactor/verify.bsh
index 27da4ab..6d1ae09 100644
--- a/src/it/reactor/verify.bsh
+++ b/src/it/reactor/verify.bsh
@@ -34,4 +34,9 @@
     throw new Exception( "Unexpected dependency tree" );
 }
 
+if ( !new File( basedir, "resolved-module-z-deps-y.txt" ).exists() )
+{
+    throw new Exception( "resolved-module-z-deps-y.txt was not written by ResolveDependenciesLifecycleParticipant" );
+}
+
 return true;