mirror of https://github.com/apache/maven.git
Resolving MNG-851. Using MavenProject.getFile() rather than constructing new. Also fixed maven-deploy-plugin with similar bug.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280405 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
db945f1dd0
commit
459737fa5f
|
@ -185,6 +185,8 @@ it0064: Test the use of a mojo that uses setters instead of private fields
|
|||
|
||||
it0065: Test that the basedir of the parent is set correctly.
|
||||
|
||||
it0066: Test that nonstandard POM files will be installed correctly.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
- generated sources
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
it0066
|
||||
it0065
|
||||
it0064
|
||||
it0063
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
-f other-pom.xml
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
install
|
|
@ -0,0 +1,7 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven.it</groupId>
|
||||
<artifactId>maven-it0066</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
</project>
|
|
@ -57,11 +57,11 @@ public class DeployMojo
|
|||
private String packaging;
|
||||
|
||||
/**
|
||||
* @parameter expression="${project.file.parentFile}"
|
||||
* @parameter expression="${project.file}"
|
||||
* @required
|
||||
* @readonly
|
||||
*/
|
||||
private File parentDir;
|
||||
private File pomFile;
|
||||
|
||||
/**
|
||||
* @parameter expression="${project.build.directory}"
|
||||
|
@ -120,10 +120,9 @@ public class DeployMojo
|
|||
|
||||
// Deploy the POM
|
||||
boolean isPomArtifact = "pom".equals( packaging );
|
||||
File pom = new File( parentDir, "pom.xml" );
|
||||
if ( !isPomArtifact )
|
||||
{
|
||||
ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pom );
|
||||
ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
|
||||
artifact.addMetadata( metadata );
|
||||
}
|
||||
|
||||
|
@ -136,7 +135,7 @@ public class DeployMojo
|
|||
{
|
||||
if ( isPomArtifact )
|
||||
{
|
||||
deployer.deploy( pom, artifact, deploymentRepository, localRepository );
|
||||
deployer.deploy( pomFile, artifact, deploymentRepository, localRepository );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -45,11 +45,11 @@ public class InstallMojo
|
|||
protected String packaging;
|
||||
|
||||
/**
|
||||
* @parameter expression="${basedir}"
|
||||
* @parameter expression="${project.file}"
|
||||
* @required
|
||||
* @readonly
|
||||
*/
|
||||
private File basedir;
|
||||
private File pomFile;
|
||||
|
||||
/**
|
||||
* @parameter expression="${project.build.directory}"
|
||||
|
@ -89,10 +89,9 @@ public class InstallMojo
|
|||
// TODO: push into transformation
|
||||
boolean isPomArtifact = "pom".equals( packaging );
|
||||
|
||||
File pom = new File( basedir, "pom.xml" );
|
||||
if ( !isPomArtifact )
|
||||
{
|
||||
ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pom );
|
||||
ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
|
||||
artifact.addMetadata( metadata );
|
||||
}
|
||||
|
||||
|
@ -105,7 +104,7 @@ public class InstallMojo
|
|||
{
|
||||
if ( isPomArtifact )
|
||||
{
|
||||
installer.install( pom, artifact, localRepository );
|
||||
installer.install( pomFile, artifact, localRepository );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue