mirror of https://github.com/apache/maven.git
Fixed MNG-805. It's a bit of a workaround but fits nicely with the
workaround style already in place. Modified it0012 to be useful (it always succeeded!) and added a child project to demonstrate this commit fixes MNG-805. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@278741 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6f72bd51df
commit
3b56df09be
|
@ -0,0 +1,19 @@
|
|||
<model>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core-it0012-child-project</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>3.0.3</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-core-it-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/</outputDirectory>
|
||||
<pluginFile>child-touch-${version}.txt</pluginFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</model>
|
|
@ -1 +1,2 @@
|
|||
target/classes/org/apache/maven/it0012/PersonFinder.class
|
||||
target/touch-3.8.1.txt
|
||||
child-project/target/child-touch-3.0.3.txt
|
||||
|
|
|
@ -1 +1 @@
|
|||
compile
|
||||
core-it:touch
|
||||
|
|
|
@ -4,20 +4,19 @@
|
|||
<artifactId>maven-core-it0012</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>3.8.1</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0-beta-1-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${version}</version>
|
||||
<type>jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-core-it-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<configuration>
|
||||
<pluginFile>touch-${version}.txt</pluginFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<modules>
|
||||
<module>child-project</module>
|
||||
</modules>
|
||||
</model>
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package org.apache.maven.it0012;
|
||||
|
||||
public class PersonFinder
|
||||
{
|
||||
private org.apache.maven.plugin.Mojo mojo;
|
||||
}
|
|
@ -580,7 +580,19 @@ public class DefaultMavenProjectBuilder
|
|||
// [BP] - Can this above comment be explained?
|
||||
// We don't need all the project methods that are added over those in the model, but we do need basedir
|
||||
Map context = new HashMap( System.getProperties() );
|
||||
context.put( "basedir", project.getBasedir() );
|
||||
|
||||
// FIXME: why is project.file not filled in here? MavenProject.getBasedir() defaults
|
||||
// to the current directory which causes all sorts of problems; might be better off
|
||||
// setting that to null and just filling in the project file name and removing this.
|
||||
|
||||
if ( pomLocation != null && new File( pomLocation ).getParent() != null )
|
||||
{
|
||||
context.put( "basedir", new File( pomLocation ).getParent() );
|
||||
}
|
||||
else
|
||||
{
|
||||
context.put( "basedir", project.getBasedir() );
|
||||
}
|
||||
|
||||
model = modelInterpolator.interpolate( model, context );
|
||||
|
||||
|
|
Loading…
Reference in New Issue