//To change body of implemented methods use File | Settings | File Templates.
}
- public void updateProjectReference( String repoId, String namespace, String projectId, String projectVersion,
- ProjectVersionReference reference )
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
public void updateNamespace( String repoId, String namespace )
{
//To change body of implemented methods use File | Settings | File Templates.
throw new UnsupportedOperationException();
}
- public void updateProjectReference( String arg0, String arg1, String arg2, String arg3,
- ProjectVersionReference arg4 )
- {
- throw new UnsupportedOperationException();
- }
-
public void updateProjectVersion( String arg0, String arg1, String arg2, ProjectVersionMetadata arg3 )
{
throw new UnsupportedOperationException();
throw new UnsupportedOperationException();
}
- public void updateProjectReference( String repoId, String namespace, String projectId, String projectVersion,
- ProjectVersionReference reference )
- {
- throw new UnsupportedOperationException();
- }
-
public void updateNamespace( String repoId, String namespace )
{
throw new UnsupportedOperationException();
//To change body of implemented methods use File | Settings | File Templates.
}
- public void updateProjectReference( String repoId, String namespace, String projectId, String projectVersion,
- ProjectVersionReference reference )
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
public void updateNamespace( String repoId, String namespace )
{
//To change body of implemented methods use File | Settings | File Templates.
*/
import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.Dependency;
import org.apache.archiva.metadata.model.ProjectMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.model.ProjectVersionReference;
ref.setProjectId( projectId );
ref.setProjectVersion( projectVersion );
ref.setReferenceType( ProjectVersionReference.ReferenceType.DEPENDENCY );
- for ( Dependency dependency : metadata.getDependencies() )
- {
- try
- {
- metadataRepository.updateProjectReference( repoId, dependency.getGroupId(),
- dependency.getArtifactId(),
- dependency.getVersion(), ref );
- }
- catch ( MetadataRepositoryException e )
- {
- log.warn( "Unable to persist resolved information: " + e.getMessage(), e );
- }
- }
}
try
{
ProjectVersionMetadata versionMetadata )
throws MetadataRepositoryException;
- void updateProjectReference( String repositoryId, String namespace, String projectId, String projectVersion,
- ProjectVersionReference reference )
- throws MetadataRepositoryException;
-
void updateNamespace( String repositoryId, String namespace )
throws MetadataRepositoryException;
//To change body of implemented methods use File | Settings | File Templates.
}
- public void updateProjectReference( String repoId, String namespace, String projectId, String projectVersion,
- ProjectVersionReference reference )
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
public void updateNamespace( String repoId, String namespace )
{
//To change body of implemented methods use File | Settings | File Templates.
i++;
}
i = 0;
+ ProjectVersionReference reference = new ProjectVersionReference();
+ reference.setNamespace( namespace );
+ reference.setProjectId( projectId );
+ reference.setProjectVersion( versionMetadata.getId() );
+ reference.setReferenceType( ProjectVersionReference.ReferenceType.DEPENDENCY );
for ( Dependency dependency : versionMetadata.getDependencies() )
{
setProperty( properties, "dependency." + i + ".classifier", dependency.getClassifier() );
setProperty( properties, "dependency." + i + ".version", dependency.getVersion() );
setProperty( properties, "dependency." + i + ".type", dependency.getType() );
setProperty( properties, "dependency." + i + ".optional", String.valueOf( dependency.isOptional() ) );
+
+ updateProjectReference( repoId, dependency.getGroupId(), dependency.getArtifactId(),
+ dependency.getVersion(), reference );
+
i++;
}
Set<String> facetIds = new LinkedHashSet<String>( versionMetadata.getFacetIds() );
}
}
- public void updateProjectReference( String repoId, String namespace, String projectId, String projectVersion,
- ProjectVersionReference reference )
+ private void updateProjectReference( String repoId, String namespace, String projectId, String projectVersion,
+ ProjectVersionReference reference )
{
File directory = new File( getDirectory( repoId ), namespace + "/" + projectId + "/" + projectVersion );
}
}
- // FIXME: remove this and projectversionreference
- public void updateProjectReference( String repositoryId, String namespace, String projectId, String projectVersion,
- ProjectVersionReference reference )
- throws MetadataRepositoryException
- {
- // not using weak references, since they still need to exist upfront to be referred to
- try
- {
- Node node = getOrAddRepositoryContentNode( repositoryId );
- node = JcrUtils.getOrAddNode( node, namespace );
- node = JcrUtils.getOrAddNode( node, projectId );
- node = JcrUtils.getOrAddNode( node, projectVersion );
- node = JcrUtils.getOrAddNode( node, "references" );
- node = JcrUtils.getOrAddNode( node, reference.getNamespace() );
- node = JcrUtils.getOrAddNode( node, reference.getProjectId() );
- node = JcrUtils.getOrAddNode( node, reference.getProjectVersion() );
- node.setProperty( "type", reference.getReferenceType().toString() );
- }
- catch ( RepositoryException e )
- {
- throw new MetadataRepositoryException( e.getMessage(), e );
- }
- }
-
public void updateNamespace( String repositoryId, String namespace )
throws MetadataRepositoryException
{