public Metadata setFile( File file ) { return new DefaultMetadata( groupId, artifactId, version, type, nature, file ); }
@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 );