public String getArtifactId() { return metadata.storedInGroupDirectory() ? "" : emptify( metadata.getArtifactId() ); }
private String pathOfRepositoryMetadata( ArtifactMetadata metadata, String filename ) { StringBuilder path = new StringBuilder( 128 ); path.append( formatAsDirectory( metadata.getGroupId() ) ).append( PATH_SEPARATOR ); if ( !metadata.storedInGroupDirectory() ) { path.append( metadata.getArtifactId() ).append( PATH_SEPARATOR ); if ( metadata.storedInArtifactVersionDirectory() ) { path.append( metadata.getBaseVersion() ).append( PATH_SEPARATOR ); } } path.append( filename ); return path.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 ); }
@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 ); }