From 0c021975aaeeff16882ef221c7681a7ec1a7b85a Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Fri, 29 May 2009 20:35:37 +0000 Subject: [PATCH] o look for the pom first git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@780101 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/ReactorArtifactRepository.java | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/ReactorArtifactRepository.java b/maven-core/src/main/java/org/apache/maven/ReactorArtifactRepository.java index b0bd94326c..fdfc9cf22c 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorArtifactRepository.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorArtifactRepository.java @@ -35,35 +35,7 @@ public class ReactorArtifactRepository if ( project != null ) { - File artifactFile = project.getArtifact().getFile(); - - if ( artifactFile != null && artifactFile.exists() ) - { - //TODO: This is really completely wrong and should probably be based on the phase that is currently being executed. - // If we are running before the packaging phase there is going to be no archive anyway, but if we are running prior to package - // we shouldn't even take the archive anyway. - - artifact.setFile( artifactFile ); - - artifact.setFromAuthoritativeRepository( true ); - - artifact.setResolved( true ); - } - /* - - TODO: This is being left out because Maven 2.x does not set this internally and it is only done by the compiler - plugin and not done generally. This should be done generally but currently causes problems with MNG-3023 - - else if ( new File( project.getBuild().getOutputDirectory() ).exists() ) - { - artifact.setFile( new File( project.getBuild().getOutputDirectory() ) ); - - artifact.setFromAuthoritativeRepository( true ); - - artifact.setResolved( true ); - } - */ - else if ( artifact.getType().equals( "pom" ) ) + if ( artifact.getType().equals( "pom" ) ) { artifact.setFile( project.getFile() ); @@ -71,6 +43,37 @@ public class ReactorArtifactRepository artifact.setResolved( true ); } + else + { + File artifactFile = project.getArtifact().getFile(); + + if ( artifactFile != null && artifactFile.exists() ) + { + //TODO: This is really completely wrong and should probably be based on the phase that is currently being executed. + // If we are running before the packaging phase there is going to be no archive anyway, but if we are running prior to package + // we shouldn't even take the archive anyway. + + artifact.setFile( artifactFile ); + + artifact.setFromAuthoritativeRepository( true ); + + artifact.setResolved( true ); + } + /* + + TODO: This is being left out because Maven 2.x does not set this internally and it is only done by the compiler + plugin and not done generally. This should be done generally but currently causes problems with MNG-3023 + + else if ( new File( project.getBuild().getOutputDirectory() ).exists() ) + { + artifact.setFile( new File( project.getBuild().getOutputDirectory() ) ); + + artifact.setFromAuthoritativeRepository( true ); + + artifact.setResolved( true ); + } + */ + } } return artifact;