コード例 #1
0
  public IArtifactDescriptor createArtifactDescriptor(
      IArtifactKey key, WriteSessionContext writeSession) {
    if (writeSession == null) {
      throw new IllegalStateException("Unexpected artifact write operation");
    }

    ArtifactDescriptor result = new ModuleArtifactDescriptor(key);

    // TODO 348586 use GAV from module
    result.setProperty(RepositoryLayoutHelper.PROP_GROUP_ID, "");
    result.setProperty(RepositoryLayoutHelper.PROP_ARTIFACT_ID, "");
    result.setProperty(RepositoryLayoutHelper.PROP_VERSION, "0.0.1");

    result.setProperty(
        RepositoryLayoutHelper.PROP_CLASSIFIER, writeSession.getClassifierForNewKey(key));

    return result;
  }
コード例 #2
0
 private static ArtifactDescriptor createDescriptorWithGAV(
     IArtifactDescriptor descriptor, IArtifactFacade mavenArtifact) {
   ArtifactDescriptor internalDescriptor = new ArtifactDescriptor(descriptor);
   // set the GAV properties so that the artifact is read from the GAV location
   // TODO join all the artifact addressing logic of AbstractMavenArtifactRepository somewhere
   internalDescriptor.setProperty(
       RepositoryLayoutHelper.PROP_GROUP_ID, mavenArtifact.getGroupId());
   internalDescriptor.setProperty(
       RepositoryLayoutHelper.PROP_ARTIFACT_ID, mavenArtifact.getArtifactId());
   internalDescriptor.setProperty(
       RepositoryLayoutHelper.PROP_VERSION, mavenArtifact.getVersion());
   internalDescriptor.setProperty(RepositoryLayoutHelper.PROP_CLASSIFIER, null);
   internalDescriptor.setProperty(RepositoryLayoutHelper.PROP_EXTENSION, null);
   return internalDescriptor;
 }
コード例 #3
0
 public void addDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor) {
   ((ArtifactDescriptor) descriptor).setRepository(this);
   artifactDescriptors.add(descriptor);
   keysToLocations.put(descriptor.getArtifactKey(), null);
 }