cleanup, reformat

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@219588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-07-19 01:11:17 +00:00
parent 84a58b99ec
commit 853b70081b
3 changed files with 23 additions and 20 deletions

View File

@ -39,9 +39,16 @@ public class DefaultArtifact
private final String artifactId;
/**
* The resolved version for the artifact after conflict resolution and all transformations.
*/
private String version;
// TODO: should be final
/**
* The resolved version for the artifact after conflict resolution, that has not been transformed.
*
* @todo should be final
*/
private String baseVersion;
private final String type;
@ -72,6 +79,7 @@ public class DefaultArtifact
this.artifactId = artifactId;
// TODO: this would be where we might have a min/max instead
this.version = version;
this.artifactHandler = artifactHandler;

View File

@ -86,9 +86,7 @@ public class DefaultArtifactFactory
}
ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( type );
DefaultArtifact artifact = new DefaultArtifact( groupId, artifactId, version, desiredScope, type, classifier,
handler );
return artifact;
return new DefaultArtifact( groupId, artifactId, version, desiredScope, type, classifier, handler );
}
}

View File

@ -16,18 +16,15 @@ package org.apache.maven.plugin.transformer;
* limitations under the License.
*/
import java.util.Iterator;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Plugin;
import org.dom4j.Element;
import org.dom4j.Node;
import java.util.Iterator;
/**
*
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*
* @version $Id: VersionTransformer.java 115421 2004-06-01 02:20:18Z dion $
*/
public class VersionTransformer
@ -94,14 +91,14 @@ public class VersionTransformer
}
Node version = node.selectSingleNode( "version" );
String versionText = getDependency( groupId.getText(), artifactId.getText(), typeText ).getVersion();
if ( version != null )
{
version.setText( getDependency( groupId.getText(), artifactId.getText(), typeText ).getVersion() );
version.setText( versionText );
}
else
{
dependency.addElement( "version" ).addText( getDependency( groupId.getText(), artifactId.getText(),
type.getText() ).getVersion() );
dependency.addElement( "version" ).addText( versionText );
}
}
else if ( selectPluginsNodesXPathExpression().equals( node.getPath() ) )
@ -147,9 +144,9 @@ public class VersionTransformer
{
// Modify scm tag
Element scm = (Element) node;
Node tag = node.selectSingleNode( "tag" );
if ( tag == null )
{
if ( !"HEAD".equals( getUpdatedModel().getScm().getTag() ) )
@ -161,10 +158,10 @@ public class VersionTransformer
{
tag.setText( getUpdatedModel().getScm().getTag() );
}
// Modify scmConnections
Node connection = node.selectSingleNode( "connection" );
if ( connection != null )
{
if ( !connection.getText().equals( getUpdatedModel().getScm().getConnection() ) )
@ -172,9 +169,9 @@ public class VersionTransformer
connection.setText( getUpdatedModel().getScm().getConnection() );
}
}
Node developerConnection = node.selectSingleNode( "developerConnection" );
if ( developerConnection != null )
{
if ( !developerConnection.getText().equals( getUpdatedModel().getScm().getDeveloperConnection() ) )
@ -192,8 +189,8 @@ public class VersionTransformer
{
Dependency dependency = (Dependency) i.next();
if ( dependency.getGroupId().equals( groupId ) && dependency.getArtifactId().equals( artifactId )
&& dependency.getType().equals( type ) )
if ( dependency.getGroupId().equals( groupId ) && dependency.getArtifactId().equals( artifactId ) &&
dependency.getType().equals( type ) )
{
return dependency;
}