public Metadata setFile( File file ) { return new DefaultMetadata( groupId, artifactId, version, type, nature, file ); }
@Override public String toString() { StringBuilder buffer = new StringBuilder( 128 ); if ( getGroupId().length() > 0 ) { buffer.append( getGroupId() ); } if ( getArtifactId().length() > 0 ) { buffer.append( ':' ).append( getArtifactId() ); } if ( getVersion().length() > 0 ) { buffer.append( ':' ).append( getVersion() ); } buffer.append( '/' ).append( getType() ); return buffer.toString(); }
@Override public String getPathForLocalMetadata( ProjectBuildingRequest buildingRequest, ArtifactMetadata metadata ) { Metadata aetherMetadata = new DefaultMetadata( metadata.getGroupId(), metadata.storedInGroupDirectory() ? null : metadata.getArtifactId(), metadata.storedInArtifactVersionDirectory() ? metadata.getBaseVersion() : null, "maven-metadata.xml", Nature.RELEASE_OR_SNAPSHOT ); RepositorySystemSession session; try { session = (RepositorySystemSession) Invoker.invoke( buildingRequest, "getRepositorySession" ); } catch ( RepositoryManagerException e ) { throw new RuntimeException( e.getMessage(), e ); } return session.getLocalRepositoryManager().getPathForLocalMetadata( aetherMetadata ); }
new DefaultMetadata( artifact.getGroupId(), artifact.getArtifactId(), MAVEN_METADATA_XML, Metadata.Nature.RELEASE_OR_SNAPSHOT );