Permalink
Browse files

Update to maven-verifier 1.4. Strip out the entire log content which …

…is include in the exception message by default, instead point to log file.
  • Loading branch information...
1 parent 8b46489 commit 953945d1d308eafdd184e8c7cf919c2c8352e07e @jdillon jdillon committed Jan 7, 2013
@@ -134,7 +134,7 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-verifier</artifactId>
- <version>1.2</version>
+ <version>1.4</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
@@ -16,6 +16,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.apache.maven.it.VerificationException;
import org.apache.maven.it.Verifier;
@@ -42,10 +43,24 @@ public Verifier createMavenVerifier( final MavenDeployment mavenDeployment )
throws VerificationException, IOException
{
System.setProperty( "maven.home", mavenDeployment.getMavenHomeFile().getAbsolutePath() );
- Verifier verifier = new Verifier( mavenDeployment.getMavenProjectFile().getAbsolutePath(), false );
+ Verifier verifier = new Verifier( mavenDeployment.getMavenProjectFile().getAbsolutePath() )
+ {
+ @Override
+ public void executeGoals(List<String> goals, Map envVars) throws VerificationException {
+ try {
+ super.executeGoals(goals, envVars);
+ }
+ catch (VerificationException e) {
+ // HACK: Strip out the entire log which is included in the message by default! :-(
+ File logFile = new File( getBasedir(), getLogFileName() );
+ throw new VerificationException("Goals execution failed: " + goals + "; see log for more details: " + logFile.getAbsolutePath(), e.getCause());
+ }
+ }
+ };
verifier.setLogFileName( mavenDeployment.getLogFileName() );
verifier.setLocalRepo( mavenDeployment.getLocalRepositoryFile().getAbsolutePath() );
verifier.resetStreams();
+
List<String> options = new ArrayList<String>();
options.add( "-X" );
options.add( "-Dmaven.repo.local=" + mavenDeployment.getLocalRepositoryFile().getAbsolutePath() );

0 comments on commit 953945d

Please sign in to comment.