diff options
author | Brett Porter <brett@apache.org> | 2009-11-25 03:11:22 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-11-25 03:11:22 +0000 |
commit | 46fa8834873fa1aed03fdfc499508203419e033e (patch) | |
tree | 82d0a4f247dec5c437bd8b364cc8cc33bc406693 /archiva-modules/metadata | |
parent | 7d2c217bdb9c752a573f20827c102eed6a924a54 (diff) | |
download | archiva-46fa8834873fa1aed03fdfc499508203419e033e.tar.gz archiva-46fa8834873fa1aed03fdfc499508203419e033e.zip |
[MRM-1282] clear up confusing "build" terminology, instead using project version (1.0-SNAPSHOT) and artifact version (1.0-20091112.0123456-1)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@883965 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata')
7 files changed, 31 insertions, 24 deletions
diff --git a/archiva-modules/metadata/content-model.txt b/archiva-modules/metadata/content-model.txt index d874634b1..6f9511572 100644 --- a/archiva-modules/metadata/content-model.txt +++ b/archiva-modules/metadata/content-model.txt @@ -24,7 +24,7 @@ The following is the intended content model for the metadata content repository: | | | |-- sha1= | | | |-- size= | | | |-- updated= - | | | `-- version= -- the actual version of the file + | | | `-- version= -- the actual version of the file, 1.0-20091120.012345-1 | | |-- created= | | |-- description= | | |-- name= @@ -51,4 +51,8 @@ file in the original storageUrl when it is requested 4) The API will still use separate namespace and project identifiers (the namespace can be null if there isn't one). This is chosen to allow splitting the namespace on '.', and also allowing '.' in the project identifier without splitting -5) properties with '.' may be nested in other representations such as Java models or XML, if appropriate
\ No newline at end of file +5) properties with '.' may be nested in other representations such as Java models or XML, if appropriate + +6) we only keep one set of project information for a "version" - this differs from Maven's storage of one POM per snapshot. The Maven 2 module will + take the latest. Those that need Maven's behaviour should retrieve the POM directly. Implementations are also free to store as much information + as desired within the artifact node in addition to whatever is shared in the project version node.
\ No newline at end of file diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectBuildFacet.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionFacet.java index 6b02fc8ce..8cb109fcb 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectBuildFacet.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionFacet.java @@ -19,7 +19,7 @@ package org.apache.archiva.metadata.model; * under the License. */ -public interface ProjectBuildFacet +public interface ProjectVersionFacet { String getFacetId(); } diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectBuildMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java index 712481745..c2add5b4f 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectBuildMetadata.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -public class ProjectBuildMetadata +public class ProjectVersionMetadata { private String id; @@ -44,7 +44,7 @@ public class ProjectBuildMetadata private List<License> licenses; - private Map<String, ProjectBuildFacet> facets; + private Map<String, ProjectVersionFacet> facets; public String getId() { @@ -145,16 +145,16 @@ public class ProjectBuildMetadata this.licenses.add( license ); } - public void addFacet( ProjectBuildFacet mavenProjectFacet ) + public void addFacet( ProjectVersionFacet mavenProjectFacet ) { if ( this.facets == null ) { - this.facets = new HashMap<String, ProjectBuildFacet>(); + this.facets = new HashMap<String, ProjectVersionFacet>(); } this.facets.put( mavenProjectFacet.getFacetId(), mavenProjectFacet ); } - public ProjectBuildFacet getFacet( String facetId ) + public ProjectVersionFacet getFacet( String facetId ) { return this.facets.get( facetId ); } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java index d7837a8a3..39d250aa6 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java @@ -21,7 +21,7 @@ package org.apache.archiva.metadata.repository; import java.util.Collection; -import org.apache.archiva.metadata.model.ProjectBuildMetadata; +import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.metadata.model.ProjectMetadata; /** @@ -48,22 +48,22 @@ public class DefaultMetadataResolver return metadataRepository.getProject( repoId, namespace, projectId ); } - public ProjectBuildMetadata getProjectBuild( String repoId, String namespace, String projectId, String buildId ) + public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) { - ProjectBuildMetadata metadata = metadataRepository.getProjectBuild( repoId, namespace, projectId, buildId ); - // TODO: do we want to detect changes as well by comparing timestamps? isProjectBuildNewerThan(updated) + ProjectVersionMetadata metadata = metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion ); + // TODO: do we want to detect changes as well by comparing timestamps? isProjectVersionNewerThan(updated) // in such cases we might also remove/update stale metadata, including adjusting plugin-based facets if ( metadata == null ) { - metadata = storageResolver.getProjectBuild( repoId, namespace, projectId, buildId ); - metadataRepository.updateBuild( repoId, namespace, projectId, metadata ); + metadata = storageResolver.getProjectVersion( repoId, namespace, projectId, projectVersion ); + metadataRepository.updateProjectVersion( repoId, namespace, projectId, metadata ); } return metadata; } - public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String buildId ) + public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion ) { // TODO: intercept - return metadataRepository.getArtifactVersions( repoId, namespace, projectId, buildId ); + return metadataRepository.getArtifactVersions( repoId, namespace, projectId, projectVersion ); } } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java index 6e20282c1..7b4e23737 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java @@ -20,20 +20,23 @@ package org.apache.archiva.metadata.repository; */ import org.apache.archiva.metadata.model.ArtifactMetadata; -import org.apache.archiva.metadata.model.ProjectBuildMetadata; import org.apache.archiva.metadata.model.ProjectMetadata; +import org.apache.archiva.metadata.model.ProjectVersionMetadata; public interface MetadataRepository extends MetadataResolver { /** * Update metadata for a particular project in the metadata repository, or create it if it does not already exist. + * * @param project the project metadata to create or update */ void updateProject( String repoId, ProjectMetadata project ); - void updateArtifact( String repoId, String namespace, String projectId, String buildId, ArtifactMetadata artifactMeta ); + void updateArtifact( String repoId, String namespace, String projectId, String projectVersion, + ArtifactMetadata artifactMeta ); - void updateBuild( String repoId, String namespace, String projectId, ProjectBuildMetadata build ); + void updateProjectVersion( String repoId, String namespace, String projectId, + ProjectVersionMetadata versionMetadata ); } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java index fd2cf83d4..7050b0552 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java @@ -21,14 +21,14 @@ package org.apache.archiva.metadata.repository; import java.util.Collection; -import org.apache.archiva.metadata.model.ProjectBuildMetadata; +import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.metadata.model.ProjectMetadata; public interface MetadataResolver { ProjectMetadata getProject( String repoId, String namespace, String projectId ); - ProjectBuildMetadata getProjectBuild( String repoId, String namespace, String projectId, String buildId ); + ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ); - Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String buildId ); + Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion ); } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java index 3a581d696..f7a50e7d5 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java @@ -23,7 +23,7 @@ import java.io.File; public interface RepositoryPathTranslator { - File toFile( File basedir, String namespace, String projectId, String buildId, String filename ); + File toFile( File basedir, String namespace, String projectId, String projectVersion, String filename ); - String toPath( String namespace, String projectId, String buildId, String filename ); + String toPath( String namespace, String projectId, String projectVersion, String filename ); } |