archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milos Kleint" <mkle...@gmail.com>
Subject Re: svn commit: r480817 - in /maven/archiva/trunk: archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/record/ archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/ archiva-reports-standard/src/test/java/org/apache/mav
Date Thu, 30 Nov 2006 13:11:08 GMT
confirmed. when I tried to run archiva on top of the central repo, I
got to exactly same place. I deleted the backport, another jar like
that appeared.
I solved the problem by using my mevenide UI frontend where I catched
the InvalidArtifactRTException and recovered gracefully by kicking out
the faulty jar artifact.

Milos

On 11/30/06, Joakim Erdfelt <joakim@erdfelt.com> wrote:
> The fact that we tie together the discovery, indexing, and reporting is how.
> We shouldn't have done that.
>
> This tree triggers the IllegalStateException -
> http://repo1.maven.org/maven2/backport175/backport175-intellij/
>
> edu.emory.mathcs.backport.java.util.concurrent.ExecutionException:
> java.lang.IllegalStateException: Couldn't find artifact
> /home/repo1/ibiblio/backport175/backport175-intellij/1.0/backport175-intellij-1.0.zip
>         at
> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.getResult(FutureTask.java:299)
>         at
> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.get(FutureTask.java:118)
>         at
> org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.waitForTask(ThreadedTaskQueueExecutor.java:159)
>         at
> org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.run(ThreadedTaskQueueExecutor.java:127)
> Caused by: java.lang.IllegalStateException: Couldn't find artifact
> /home/repo1/ibiblio/backport175/backport175-intellij/1.0/backport175-intellij-1.0.zip
>         at
> org.apache.maven.archiva.reporting.LocationArtifactReportProcessor.processArtifact(LocationArtifactReportProcessor.java:143)
>         at
> org.apache.maven.archiva.reporting.AbstractReportGroup.processArtifact(AbstractReportGroup.java:53)
>         at
> org.apache.maven.archiva.reporting.DefaultReportExecutor.runArtifactReports(DefaultReportExecutor.java:126)
>         at
> org.apache.maven.archiva.scheduler.executors.IndexerTaskExecutor.execute(IndexerTaskExecutor.java:242)
>
> This tree triggers the InvalidArtifactRTException -
> http://repo1.maven.org/maven2/berkano/
> edu.emory.mathcs.backport.java.util.concurrent.ExecutionException:
> org.apache.maven.artifact.InvalidArtifactRTException: For artifact
> {null:berkano-bookmarks:${berkanoVersion}:jar}: The groupId cannot be empty.
>         at
> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.getResult(FutureTask.java:299)
>         at
> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.get(FutureTask.java:118)
>         at
> org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.waitForTask(ThreadedTaskQueueExecutor.java:159)
>         at
> org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable.run(ThreadedTaskQueueExecutor.java:127)
> Caused by: org.apache.maven.artifact.InvalidArtifactRTException: For
> artifact {null:berkano-bookmarks:${berkanoVersion}:jar}: The groupId
> cannot be empty.
>         at
> org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:126)
>         at
> org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:119)
>         at
> org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:155)
>         at
> org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:114)
>         at
> org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:108)
>
> - Joakim Erdfelt
>
> Brett Porter wrote:
> > All of these are meant to indicate programming errors - the RT
> > exceptions should be guarded by checking the validity of the POM used
> > to create the artifacts. As for the illegalstateexception - how is the
> > reports module getting handed a file that doesn't exist to report on?
> >
> > - Brett
> >
> > On 30/11/2006, at 2:32 PM, joakime@apache.org wrote:
> >
> >> Author: joakime
> >> Date: Wed Nov 29 19:32:08 2006
> >> New Revision: 480817
> >>
> >> URL: http://svn.apache.org/viewvc?view=rev&rev=480817
> >> Log:
> >> * Correcting LocationArtifactReportProcessor to not throw
> >> IllegalStateException as it halts the discovery and indexing.
> >> * Catching InvalidArtifactRTException in DefaultReportExecutor to
> >> allow discovery and indexing to proceed to next artifact unhindered.
> >> * Catching InvalidArtifactRTException in
> >> StandardArtifactIndexRecordFactory to allow discovery and indexeing
> >> to proceed to next artifact unhindered.
> >>
> >>
> >> Modified:
> >>
> >> maven/archiva/trunk/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/record/StandardArtifactIndexRecordFactory.java
> >>
> >>
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultReportExecutor.java
> >>
> >>
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessor.java
> >>
> >>
> >> maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java
> >>
> >>
> >> Modified:
> >> maven/archiva/trunk/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/record/StandardArtifactIndexRecordFactory.java
> >>
> >> URL:
> >> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/record/StandardArtifactIndexRecordFactory.java?view=diff&rev=480817&r1=480816&r2=480817
> >>
> >> ==============================================================================
> >>
> >> ---
> >> maven/archiva/trunk/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/record/StandardArtifactIndexRecordFactory.java
> >> (original)
> >> +++
> >> maven/archiva/trunk/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/record/StandardArtifactIndexRecordFactory.java
> >> Wed Nov 29 19:32:08 2006
> >> @@ -18,6 +18,7 @@
> >>
> >>  import org.apache.maven.archiva.indexer.RepositoryIndexException;
> >>  import org.apache.maven.artifact.Artifact;
> >> +import org.apache.maven.artifact.InvalidArtifactRTException;
> >>  import org.apache.maven.artifact.factory.ArtifactFactory;
> >>  import org.apache.maven.artifact.repository.ArtifactRepository;
> >>  import org.apache.maven.model.Dependency;
> >> @@ -251,8 +252,17 @@
> >>      {
> >>          // TODO: this can create a -SNAPSHOT.pom when it didn't
> >> exist and a timestamped one did. This is harmless, but should be avoided
> >>          // TODO: will this pollute with local repo metadata?
> >> -        MavenProject project = projectBuilder.buildFromRepository(
> >> artifact, Collections.EMPTY_LIST, repository );
> >> -        return project.getModel();
> >> +
> >> +        try
> >> +        {
> >> +            MavenProject project =
> >> projectBuilder.buildFromRepository( artifact, Collections.EMPTY_LIST,
> >> repository );
> >> +            return project.getModel();
> >> +        }
> >> +        catch ( InvalidArtifactRTException e )
> >> +        {
> >> +            throw new ProjectBuildingException( artifact.getId(),
> >> "Unable to build project from invalid artifact ["
> >> +                + artifact + "]", e );
> >> +        }
> >>      }
> >>
> >>      private void populateArchiveEntries( List files,
> >> StandardArtifactIndexRecord record, File artifactFile )
> >>
> >> Modified:
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultReportExecutor.java
> >>
> >> URL:
> >> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultReportExecutor.java?view=diff&rev=480817&r1=480816&r2=480817
> >>
> >> ==============================================================================
> >>
> >> ---
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultReportExecutor.java
> >> (original)
> >> +++
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultReportExecutor.java
> >> Wed Nov 29 19:32:08 2006
> >> @@ -21,6 +21,7 @@
> >>  import org.apache.maven.archiva.discoverer.MetadataDiscoverer;
> >>  import
> >> org.apache.maven.archiva.discoverer.filter.AcceptAllMetadataFilter;
> >>  import org.apache.maven.artifact.Artifact;
> >> +import org.apache.maven.artifact.InvalidArtifactRTException;
> >>  import org.apache.maven.artifact.factory.ArtifactFactory;
> >>  import org.apache.maven.artifact.repository.ArtifactRepository;
> >>  import
> >> org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
> >> @@ -115,6 +116,10 @@
> >>                      projectBuilder.buildFromRepository( pomArtifact,
> >> Collections.EMPTY_LIST, repository );
> >>
> >>                  model = project.getModel();
> >> +            }
> >> +            catch ( InvalidArtifactRTException e )
> >> +            {
> >> +                reporter.addWarning( artifact, null, null, "Invalid
> >> artifact [" + artifact + "] : " + e );
> >>              }
> >>              catch ( ProjectBuildingException e )
> >>              {
> >>
> >> Modified:
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessor.java
> >>
> >> URL:
> >> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessor.java?view=diff&rev=480817&r1=480816&r2=480817
> >>
> >> ==============================================================================
> >>
> >> ---
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessor.java
> >> (original)
> >> +++
> >> maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessor.java
> >> Wed Nov 29 19:32:08 2006
> >> @@ -113,7 +113,7 @@
> >>              }
> >>          }
> >>
> >> -        //get the location of the artifact itself
> >> +        // get the location of the artifact itself
> >>          File file = new File( repository.getBasedir(), artifactPath );
> >>
> >>          if ( file.exists() )
> >> @@ -140,7 +140,7 @@
> >>          }
> >>          else
> >>          {
> >> -            throw new IllegalStateException( "Couldn't find artifact
> >> " + file );
> >> +            addFailure( reporter, artifact, "missing-artifact", "The
> >> artifact file [" + file + "] cannot be found for metadata." );
> >>          }
> >>      }
> >>
> >>
> >> Modified:
> >> maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java
> >>
> >> URL:
> >> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java?view=diff&rev=480817&r1=480816&r2=480817
> >>
> >> ==============================================================================
> >>
> >> ---
> >> maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java
> >> (original)
> >> +++
> >> maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/LocationArtifactReportProcessorTest.java
> >> Wed Nov 29 19:32:08 2006
> >> @@ -157,16 +157,10 @@
> >>          Artifact artifact = createArtifact( "groupId", "artifactId",
> >> "1.0-alpha-2" );
> >>          Artifact pomArtifact = createArtifact( "groupId",
> >> "artifactId", "1.0-alpha-2", "pom" );
> >>
> >> -        try
> >> -        {
> >> -            Model model = readPom( repository.pathOf( pomArtifact ) );
> >> -            artifactReportProcessor.processArtifact( artifact,
> >> model, reportDatabase );
> >> -            fail( "Should not have passed the artifact" );
> >> -        }
> >> -        catch ( IllegalStateException e )
> >> -        {
> >> -            // correct!
> >> -        }
> >> +        Model model = readPom( repository.pathOf( pomArtifact ) );
> >> +        artifactReportProcessor.processArtifact( artifact, model,
> >> reportDatabase );
> >> +
> >> +        assertEquals( 1, reportDatabase.getNumFailures() );
> >>      }
> >>
> >>      /**
> >>
> >
>
>

Mime
View raw message