public void merge( ArtifactMetadata metadata ) { // TODO not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact // replaces? AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata; this.metadata.merge( repoMetadata.getMetadata() ); }
public void storeInLocalRepository( ArtifactRepository localRepository, ArtifactRepository remoteRepository ) throws RepositoryMetadataStoreException { try { updateRepositoryMetadata( localRepository, remoteRepository ); } catch ( IOException | XmlPullParserException e ) { throw new RepositoryMetadataStoreException( "Error updating group repository metadata", e ); } }
private static int getBuildNumber( Metadata metadata ) { int number = 0; Versioning versioning = metadata.getVersioning(); if ( versioning != null ) { Snapshot snapshot = versioning.getSnapshot(); if ( snapshot != null && snapshot.getBuildNumber() > 0 ) { number = snapshot.getBuildNumber(); } } return number; }
private ArtifactMetadata createMetadata( Artifact artifact ) { Versioning versioning = new Versioning(); versioning.updateTimestamp(); versioning.addVersion( artifact.getVersion() ); if ( artifact.isRelease() ) { versioning.setRelease( artifact.getVersion() ); } return new ArtifactRepositoryMetadata( artifact, versioning ); }
protected static Versioning createVersioning( Snapshot snapshot ) { Versioning versioning = new Versioning(); versioning.setSnapshot( snapshot ); versioning.updateTimestamp(); return versioning; }
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository ) { if ( artifact.isSnapshot() ) { Snapshot snapshot = new Snapshot(); snapshot.setLocalCopy( true ); RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact, snapshot ); artifact.addMetadata( metadata ); } }
public String getVersion() { return metadata.getVersion(); }
public GroupRepositoryMetadata( String groupId ) { super( new Metadata() ); this.groupId = groupId; }
protected String constructVersion( Versioning versioning, String baseVersion ) { return versioning.getRelease(); } }
protected String constructVersion( Versioning versioning, String baseVersion ) { return versioning.getLatest(); } }
public String getArtifactId() { return metadata.getArtifactId(); }
public static Metadata cloneMetadata( Metadata src ) { if ( src == null ) { return null; } return src.clone(); }
public SnapshotArtifactRepositoryMetadata( Artifact artifact, Snapshot snapshot ) { super( createMetadata( artifact, createVersioning( snapshot ) ) ); this.artifact = artifact; }
public void install( ArtifactMetadata metadata, ArtifactRepository localRepository ) throws RepositoryMetadataInstallationException { try { metadata.storeInLocalRepository( localRepository, localRepository ); } catch ( RepositoryMetadataStoreException e ) { throw new RepositoryMetadataInstallationException( "Error installing metadata: " + e.getMessage(), e ); } }
public ArtifactRepositoryMetadata( Artifact artifact, Versioning versioning ) { super( createMetadata( artifact, versioning ) ); this.artifact = artifact; }
public SnapshotArtifactRepositoryMetadata( Artifact artifact ) { super( createMetadata( artifact, null ) ); this.artifact = artifact; }
public int getNature() { return isSnapshot() ? SNAPSHOT : RELEASE; }
public String getVersion() { return metadata.getVersion(); }
public String getArtifactId() { return metadata.getArtifactId(); }
public void merge( org.apache.maven.repository.legacy.metadata.ArtifactMetadata metadata ) { // TODO not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact // replaces? AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata; this.metadata.merge( repoMetadata.getMetadata() ); }