mirror of https://github.com/apache/maven.git
handle flag in mboot
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280235 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ba1cb58030
commit
ba88f96118
|
@ -819,6 +819,11 @@ public class MBoot
|
|||
metadata.setReleaseVersion( version );
|
||||
file = localRepository.getMetadataFile( groupId, artifactId, null, type, "maven-metadata-local.xml" );
|
||||
metadata.write( file );
|
||||
|
||||
metadata = new RepositoryMetadata();
|
||||
metadata.setLocalCopy( true );
|
||||
file = localRepository.getMetadataFile( groupId, artifactId, version, type, "maven-metadata-local.xml" );
|
||||
metadata.write( file );
|
||||
}
|
||||
|
||||
private void runTests( String basedir, String classes, String testClasses, ModelReader reader,
|
||||
|
|
|
@ -75,14 +75,14 @@ public class ArtifactDownloader
|
|||
// not exists so create it if missing.
|
||||
File directory = destinationFile.getParentFile();
|
||||
|
||||
if ( directory.exists() == false )
|
||||
if ( !directory.exists() )
|
||||
{
|
||||
directory.mkdirs();
|
||||
}
|
||||
|
||||
boolean snapshot = isSnapshot( dep );
|
||||
|
||||
if ( dep.getGroupId().equals( "org.apache.maven" ) && snapshot )
|
||||
if ( "org.apache.maven".equals( dep.getGroupId() ) && snapshot )
|
||||
{
|
||||
//skip our own
|
||||
continue;
|
||||
|
@ -143,7 +143,8 @@ public class ArtifactDownloader
|
|||
File remoteFile = localRepository.getMetadataFile( dep.getGroupId(), dep.getArtifactId(),
|
||||
dep.getVersion(), dep.getType(), filename );
|
||||
String metadataPath = remoteRepo.getMetadataPath( dep.getGroupId(), dep.getArtifactId(),
|
||||
dep.getVersion(), dep.getType(), "maven-metadata.xml" );
|
||||
dep.getVersion(), dep.getType(),
|
||||
"maven-metadata.xml" );
|
||||
String metaUrl = remoteRepo.getBasedir() + "/" + metadataPath;
|
||||
log( "Downloading " + metaUrl );
|
||||
try
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TODO: describe
|
||||
* I/O for repository metadata.
|
||||
*
|
||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||
* @version $Id$
|
||||
|
@ -54,6 +54,8 @@ public class RepositoryMetadata
|
|||
|
||||
private String latestVersion;
|
||||
|
||||
private boolean localCopy;
|
||||
|
||||
public String getSnapshotTimestamp()
|
||||
{
|
||||
return snapshotTimestamp;
|
||||
|
@ -139,6 +141,16 @@ public class RepositoryMetadata
|
|||
versions.add( version );
|
||||
}
|
||||
|
||||
public boolean isLocalCopy()
|
||||
{
|
||||
return localCopy;
|
||||
}
|
||||
|
||||
public void setLocalCopy( boolean localCopy )
|
||||
{
|
||||
this.localCopy = localCopy;
|
||||
}
|
||||
|
||||
public static RepositoryMetadata read( File file )
|
||||
throws IOException, ParserConfigurationException, SAXException
|
||||
{
|
||||
|
@ -194,6 +206,10 @@ public class RepositoryMetadata
|
|||
{
|
||||
metadata.setSnapshotTimestamp( getBodyText() );
|
||||
}
|
||||
else if ( "localCopy".equals( rawName ) )
|
||||
{
|
||||
metadata.setLocalCopy( Boolean.valueOf( getBodyText() ).booleanValue() );
|
||||
}
|
||||
}
|
||||
else if ( insideVersions )
|
||||
{
|
||||
|
@ -301,6 +317,7 @@ public class RepositoryMetadata
|
|||
writeLine( w, " ", "latest", metadata.getLatestVersion() );
|
||||
writeLine( w, " ", "release", metadata.getReleaseVersion() );
|
||||
w.println( " <snapshot>" );
|
||||
writeLine( w, " ", "localCopy", String.valueOf( metadata.isLocalCopy() ) );
|
||||
writeLine( w, " ", "buildNumber", String.valueOf( metadata.getSnapshotBuildNumber() ) );
|
||||
writeLine( w, " ", "timestamp", metadata.getSnapshotTimestamp() );
|
||||
w.println( " </snapshot>" );
|
||||
|
|
Loading…
Reference in New Issue