Author: hboutemy
Date: Thu Jul 15 18:35:52 2010
New Revision: 964525
URL: http://svn.apache.org/viewvc?rev=964525&view=rev
Log:
[MANTTASKS-179] added interpolation step when building MavenProject, since it
is an additional step in Maven 2.2 (wasn't the case in Maven 2.0.x)
Modified:
maven/ant-tasks/trunk/build-tests.xml
maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/Pom.java
Modified: maven/ant-tasks/trunk/build-tests.xml
URL:
http://svn.apache.org/viewvc/maven/ant-tasks/trunk/build-tests.xml?rev=964525&r1=964524&r2=964525&view=diff
==============================================================================
--- maven/ant-tasks/trunk/build-tests.xml (original)
+++ maven/ant-tasks/trunk/build-tests.xml Thu Jul 15 18:35:52 2010
@@ -121,11 +121,11 @@
<echo>project.build.directory = ${my.maven.project.build.directory}</echo>
- <!-- MANTTASKS-179 fail message="failed to get basedir">
+ <fail message="failed to get basedir">
<condition>
<contains string="${my.maven.project.build.directory}" substring="{"/>
</condition>
- </fail-->
+ </fail>
</target>
<target name="test-pom-profiles" depends="initTaskDefs">
Modified:
maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/Pom.java
URL:
http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/Pom.java?rev=964525&r1=964524&r2=964525&view=diff
==============================================================================
--- maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/Pom.java
(original)
+++ maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/Pom.java
Thu Jul 15 18:35:52 2010
@@ -43,6 +43,7 @@ import org.apache.maven.project.MavenPro
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.project.ProjectBuilderConfiguration;
import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.interpolation.ModelInterpolationException;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.PropertyHelper;
@@ -204,10 +205,16 @@ public class Pom
try
{
mavenProject = builder.build( file, builderConfig );
+
+ builder.calculateConcreteState( mavenProject, builderConfig,
false );
+ }
+ catch ( ProjectBuildingException pbe )
+ {
+ throw new BuildException( "Unable to initialize POM " +
file.getName() + ": " + pbe.getMessage(), pbe );
}
- catch ( ProjectBuildingException e )
+ catch ( ModelInterpolationException mie )
{
- throw new BuildException( "Unable to initialize POM " +
file.getName() + ": " + e.getMessage(), e );
+ throw new BuildException( "Unable to interpolate POM " +
file.getName() + ": " + mie.getMessage(), mie );
}
}
else if ( refid != null )