diff --git a/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java b/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java index fe5d7ddbea..088d41fbfe 100644 --- a/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java +++ b/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java @@ -109,7 +109,7 @@ public class DefaultProfileAdvisor String projectId = ArtifactUtils.versionlessKey( groupId, artifactId ); - throw new ProjectBuildingException( projectId, e.getMessage(), pomFile.getAbsolutePath(), e ); + throw new ProjectBuildingException( projectId, e.getMessage(), pomFile, e ); } for ( Iterator it = activeProfiles.iterator(); it.hasNext(); ) @@ -166,7 +166,7 @@ public class DefaultProfileAdvisor catch ( ProfileActivationException e ) { throw new ProjectBuildingException( modelId, - "Failed to compute active profiles for repository aggregation.", pomFile.getAbsolutePath(), e ); + "Failed to compute active profiles for repository aggregation.", pomFile, e ); } LinkedHashSet remoteRepositories = new LinkedHashSet(); @@ -239,13 +239,13 @@ public class DefaultProfileAdvisor catch ( IOException e ) { throw new ProjectBuildingException( model.getId(), "Cannot read profiles.xml resource from directory: " - + projectDir, pomFile.getAbsolutePath(), e ); + + projectDir, pomFile, e ); } catch ( XmlPullParserException e ) { throw new ProjectBuildingException( model.getId(), "Cannot parse profiles.xml resource from directory: " + projectDir, - pomFile.getAbsolutePath(), e ); + pomFile, e ); } } } diff --git a/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java b/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java index 808fc40221..c9f8a0cc27 100644 --- a/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java @@ -198,11 +198,11 @@ public class DefaultModelLineageBuilder } catch ( IOException e ) { - throw new ProjectBuildingException( "unknown", "Failed to read model from: " + pomFile, pomFile.getAbsolutePath(), e ); + throw new ProjectBuildingException( "unknown", "Failed to read model from: " + pomFile, pomFile, e ); } catch ( XmlPullParserException e ) { - throw new ProjectBuildingException( "unknown", "Failed to parse model from: " + pomFile, pomFile.getAbsolutePath(), e ); + throw new ProjectBuildingException( "unknown", "Failed to parse model from: " + pomFile, pomFile, e ); } finally { @@ -251,7 +251,7 @@ public class DefaultModelLineageBuilder catch ( InvalidRepositoryException e ) { throw new ProjectBuildingException( model.getId(), "Failed to create ArtifactRepository list for: " - + pomFile, pomFile.getAbsolutePath(), e ); + + pomFile, pomFile, e ); } }