You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2007/08/14 22:19:02 UTC
svn commit: r565897 - in /maven/plugins/trunk/maven-deploy-plugin/src:
main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java
Author: jdcasey
Date: Tue Aug 14 13:19:01 2007
New Revision: 565897
URL: http://svn.apache.org/viewvc?view=rev&rev=565897
Log:
[MDEPLOY-56] Adding the ability to draw version from parent specification when it's missing in the local model.
Modified:
maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java
Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java?view=diff&rev=565897&r1=565896&r2=565897
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java Tue Aug 14 13:19:01 2007
@@ -268,9 +268,13 @@
{
this.artifactId = model.getArtifactId();
}
- if ( this.version == null && model.getVersion() != null )
+ if ( this.version == null )
{
- this.version = model.getVersion();
+ this.version = model.getVersion();
+ if ( this.version == null && parent != null )
+ {
+ this.version = parent.getVersion();
+ }
}
if ( this.packaging == null && model.getPackaging() != null )
{
Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java?view=diff&rev=565897&r1=565896&r2=565897
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoUnitTest.java Tue Aug 14 13:19:01 2007
@@ -93,10 +93,10 @@
try {
mojo.initProperties();
} catch (MojoExecutionException expected) {
- assertTrue( true ); // missing artifact version and packaging
+ assertTrue( true ); // missing artifactId and packaging
}
- checkMojoProperties("parentGroup", null, null, null);
+ checkMojoProperties("parentGroup", null, "parentVersion", null);
}
public void testProcessPomFromPomFileWithParent2() throws MojoExecutionException
@@ -107,10 +107,10 @@
try {
mojo.initProperties();
} catch (MojoExecutionException expected) {
- assertTrue( true ); // missing version and packaging
+ assertTrue( true ); // missing packaging
}
- checkMojoProperties("parentGroup", "artifact", null, null );
+ checkMojoProperties("parentGroup", "artifact", "parentVersion", null );
}