protected static Metadata createMetadata( Artifact artifact, Versioning versioning ) { Metadata metadata = new Metadata(); metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getVersion() ); metadata.setVersioning( versioning ); return metadata; }
metadata.setVersion( null );
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat ) { Snapshot snapshot = new Snapshot(); snapshot.setLocalCopy( true ); Versioning versioning = new Versioning(); versioning.setSnapshot( snapshot ); Metadata metadata = new Metadata(); metadata.setVersioning( versioning ); metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } return metadata; }
protected static Metadata createRepositoryMetadata( Artifact artifact, boolean legacyFormat ) { Metadata metadata = new Metadata(); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); return metadata; }
metadata.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
public void willWorkFine (Metadata metaData) { metaData.setVersion("Changed!"); }
metadata.setGroupId(artifact.getGroupId()); metadata.setArtifactId(artifact.getArtifactId()); metadata.setVersion(artifact.getVersion()); metadata.setModelVersion("1.1.0");
/** * add version to the in-memory metadata instance * * @param metadata * @return * @throws MetadataException */ public boolean perform( Metadata metadata ) throws MetadataException { if ( metadata == null ) { return false; } String vs = metadata.getVersion(); if ( vs == null ) { if ( version == null ) { return false; } } else if ( vs.equals( version ) ) { return false; } metadata.setVersion( version ); return true; }
metadata.setGroupId(artifact.getGroupId()); metadata.setArtifactId(artifact.getArtifactId()); metadata.setVersion(artifact.getVersion()); metadata.setModelVersion("1.1.0");
protected Metadata readOrCreateGMetadata( ArtifactStoreRequest request, Gav gav ) throws IllegalOperationException, IOException, MetadataException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // GA mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // G mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); Metadata result = readOrCreateMetadata( uid, request ); result.setGroupId( null ); result.setArtifactId( null ); result.setVersion( null ); return result; }
private static void replace( final Metadata metadata, final Metadata newMetadata ) { if ( metadata == null || newMetadata == null ) { return; } metadata.setArtifactId( newMetadata.getArtifactId() ); metadata.setGroupId( newMetadata.getGroupId() ); metadata.setModelEncoding( newMetadata.getModelEncoding() ); metadata.setModelVersion( newMetadata.getModelVersion() ); metadata.setPlugins( newMetadata.getPlugins() ); metadata.setVersion( newMetadata.getVersion() ); metadata.setVersioning( newMetadata.getVersioning() ); }
protected Metadata readOrCreateGAMetadata( ArtifactStoreRequest request, Gav gav ) throws IllegalOperationException, IOException, MetadataException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // GA mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); Metadata result = readOrCreateMetadata( uid, request ); result.setGroupId( gav.getGroupId() ); result.setArtifactId( gav.getArtifactId() ); result.setVersion( null ); return result; }
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat ) { Snapshot snapshot = new Snapshot(); snapshot.setLocalCopy( true ); Versioning versioning = new Versioning(); versioning.setSnapshot( snapshot ); Metadata metadata = new Metadata(); metadata.setVersioning( versioning ); metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } return metadata; }
protected Metadata readOrCreateGAVMetadata( ArtifactStoreRequest request, Gav gav ) throws IllegalOperationException, IOException, MetadataException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); Metadata result = readOrCreateMetadata( uid, request ); result.setGroupId( gav.getGroupId() ); result.setArtifactId( gav.getArtifactId() ); result.setVersion( gav.getBaseVersion() ); return result; }
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat ) { Snapshot snapshot = new Snapshot(); snapshot.setLocalCopy( true ); Versioning versioning = new Versioning(); versioning.setSnapshot( snapshot ); Metadata metadata = new Metadata(); metadata.setVersioning( versioning ); metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } return metadata; }
private Metadata createMetadata( String path ) throws IOException { try { Metadata md = new Metadata(); md.setGroupId( calculateGroupId( path ) ); md.setArtifactId( calculateArtifactId( path ) ); md.setVersion( calculateVersion( path ) ); ModelVersionUtility.setModelVersion( md, ModelVersionUtility.LATEST_MODEL_VERSION ); versioning( md, getGavs( path, metadataHelper.gavData.get( path ) ) ); return md; } catch ( MetadataException e ) { throw new IOException( e ); } }
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat ) { Snapshot snapshot = new Snapshot(); snapshot.setLocalCopy( true ); Versioning versioning = new Versioning(); versioning.setSnapshot( snapshot ); Metadata metadata = new Metadata(); metadata.setVersioning( versioning ); metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } return metadata; }
protected static Metadata createRepositoryMetadata( Artifact artifact, boolean legacyFormat ) { Metadata metadata = new Metadata(); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); return metadata; }
protected static Metadata createRepositoryMetadata( Artifact artifact, boolean legacyFormat ) { Metadata metadata = new Metadata(); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); return metadata; }
protected static Metadata createRepositoryMetadata( Artifact artifact, boolean legacyFormat ) { Metadata metadata = new Metadata(); if ( !legacyFormat ) { metadata.setModelVersion( "1.1.0" ); } metadata.setGroupId( artifact.getGroupId() ); metadata.setArtifactId( artifact.getArtifactId() ); metadata.setVersion( artifact.getBaseVersion() ); return metadata; }