summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java8
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java5
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java76
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml1
-rw-r--r--archiva-modules/metadata/metadata-repository-api/pom.xml5
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java1
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java46
-rw-r--r--archiva-modules/plugins/metadata-store-file/pom.xml5
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/pom.xml5
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java53
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java1
13 files changed, 184 insertions, 26 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
index b95fd1ee3..fbe8f85e6 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
@@ -216,7 +216,7 @@ public abstract class AbstractRestService
}
else
{
- sb.append( '.' ).append( artifact.getPackaging() );
+ sb.append( '.' ).append( artifact.getFileExtension() );
}
return sb.toString();
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
index 2ef6db202..5228ae621 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
@@ -204,7 +204,8 @@ public class DefaultBrowseService
try
{
- return new VersionsList( new ArrayList<String>( getVersions( selectedRepos, groupId, artifactId ) ) );
+ Collection<String> versions = getVersions( selectedRepos, groupId, artifactId );
+ return new VersionsList( new ArrayList<String>( versions ) );
}
catch ( MetadataResolutionException e )
{
@@ -227,8 +228,9 @@ public class DefaultBrowseService
for ( String repoId : selectedRepos )
{
- versions.addAll(
- metadataResolver.resolveProjectVersions( repositorySession, repoId, groupId, artifactId ) );
+ Collection<String> projectVersions =
+ metadataResolver.resolveProjectVersions( repositorySession, repoId, groupId, artifactId );
+ versions.addAll( projectVersions );
}
List<String> sortedVersions = new ArrayList<String>( versions );
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
index 3890a4cf3..6ee2cec2a 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
@@ -717,7 +717,7 @@ public class DefaultRepositoriesService
for ( ArtifactMetadata artifactMetadata : artifacts )
{
// TODO: mismatch between artifact (snapshot) version and project (base) version here
- if ( artifact.getVersion().equals( artifact.getVersion() ) )
+ if ( artifactMetadata.getVersion().equals( artifact.getVersion() ) )
{
metadataRepository.removeArtifact( artifactMetadata.getRepositoryId(),
artifactMetadata.getNamespace(), artifactMetadata.getProject(),
@@ -735,7 +735,10 @@ public class DefaultRepositoriesService
triggerAuditEvent( repositoryId, path, AuditEvent.REMOVE_FILE );
}
}
+
repositorySession.save();
+
+ repositorySession.close();
}
catch ( ContentNotFoundException e )
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
index ebf401d4d..085595cf4 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
@@ -55,7 +55,7 @@ public abstract class AbstractArchivaRestTest
// START SNIPPET: authz-header
// guest with an empty password
- public String guestAuthzHeader =
+ public static String guestAuthzHeader =
"Basic " + org.apache.cxf.common.util.Base64Utility.encode( ( "guest" + ":" ).getBytes() );
// with an other login/password
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
index 111653350..4ecdddbe7 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
@@ -22,11 +22,13 @@ package org.apache.archiva.rest.services;
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.common.utils.FileUtil;
import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.rest.api.model.VersionsList;
import org.apache.archiva.rest.api.services.BrowseService;
import org.apache.archiva.rest.api.services.ManagedRepositoriesService;
import org.apache.archiva.rest.api.services.RepositoriesService;
import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
import org.fest.assertions.Assertions;
+import org.junit.Ignore;
import org.junit.Test;
import java.io.File;
@@ -134,16 +136,82 @@ public class RepositoriesServiceTest
BrowseService browseService = getBrowseService( authorizationHeader, false );
List<Artifact> artifacts =
+ browseService.getArtifactDownloadInfos( "org.apache.karaf.features", "org.apache.karaf.features.core",
+ "2.2.2", SOURCE_REPO_ID );
+
+ log.info( "artifacts: {}", artifacts );
+
+ Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 2 );
+
+ VersionsList versionsList =
+ browseService.getVersionsList( "org.apache.karaf.features", "org.apache.karaf.features.core",
+ SOURCE_REPO_ID );
+ Assertions.assertThat( versionsList.getVersions() ).isNotNull().isNotEmpty().hasSize( 2 );
+
+ log.info( "artifacts.size: {}", artifacts.size() );
+
+ try
+ {
+ File artifactFile = new File(
+ "target/test-origin-repo/org/apache/karaf/features/org.apache.karaf.features.core/2.2.2/org.apache.karaf.features.core-2.2.2.jar" );
+
+ assertTrue( "artifact not exists:" + artifactFile.getPath(), artifactFile.exists() );
+
+ Artifact artifact = new Artifact();
+ artifact.setGroupId( "org.apache.karaf.features" );
+ artifact.setArtifactId( "org.apache.karaf.features.core" );
+ artifact.setVersion( "2.2.2" );
+ artifact.setPackaging( "jar" );
+ artifact.setContext( SOURCE_REPO_ID );
+
+ RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
+
+ repositoriesService.deleteArtifact( artifact );
+
+ assertFalse( "artifact not deleted exists:" + artifactFile.getPath(), artifactFile.exists() );
+
+ artifacts =
+ browseService.getArtifactDownloadInfos( "org.apache.karaf.features", "org.apache.karaf.features.core",
+ "2.2.2", SOURCE_REPO_ID );
+
+ Assertions.assertThat( artifacts ).isNotNull().isEmpty();
+
+ versionsList = browseService.getVersionsList( "org.apache.karaf.features", "org.apache.karaf.features.core",
+ SOURCE_REPO_ID );
+
+ Assertions.assertThat( versionsList.getVersions() ).isNotNull().isNotEmpty().hasSize( 1 );
+
+ }
+ finally
+ {
+ cleanRepos();
+ }
+ }
+
+ @Test
+ @Ignore
+ public void deleteArtifactWithClassifier()
+ throws Exception
+ {
+ initSourceTargetRepo();
+
+ BrowseService browseService = getBrowseService( authorizationHeader, false );
+
+ List<Artifact> artifacts =
browseService.getArtifactDownloadInfos( "commons-logging", "commons-logging", "1.0.1", SOURCE_REPO_ID );
Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 3 );
+ VersionsList versionsList =
+ browseService.getVersionsList( "commons-logging", "commons-logging", SOURCE_REPO_ID );
+ Assertions.assertThat( versionsList.getVersions() ).isNotNull().isNotEmpty().hasSize( 6 );
+
log.info( "artifacts.size: {}", artifacts.size() );
try
{
- File artifactFile =
- new File( "target/test-origin-repo/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1.jar" );
+ File artifactFile = new File(
+ "target/test-origin-repo/commons-logging/commons-logging/1.0.1/commons-logging-1.0.1-javadoc.jar" );
assertTrue( "artifact not exists:" + artifactFile.getPath(), artifactFile.exists() );
@@ -151,6 +219,7 @@ public class RepositoriesServiceTest
artifact.setGroupId( "commons-logging" );
artifact.setArtifactId( "commons-logging" );
artifact.setVersion( "1.0.1" );
+ artifact.setClassifier( "javadoc" );
artifact.setPackaging( "jar" );
artifact.setContext( SOURCE_REPO_ID );
@@ -165,6 +234,8 @@ public class RepositoriesServiceTest
Assertions.assertThat( artifacts ).isNotNull().isEmpty();
+ Assertions.assertThat( versionsList.getVersions() ).isNotNull().isNotEmpty().hasSize( 5 );
+
}
finally
{
@@ -172,6 +243,7 @@ public class RepositoriesServiceTest
}
}
+
@Test
public void authorizedToDeleteArtifacts()
throws Exception
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml
index 4478e93dc..ba9396aa6 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml
@@ -77,6 +77,7 @@
<bean id="repository" class="org.apache.jackrabbit.core.RepositoryImpl" destroy-method="shutdown">
<constructor-arg ref="config"/>
</bean>
+
<bean id="config" class="org.apache.jackrabbit.core.config.RepositoryConfig" factory-method="create">
<constructor-arg value="${basedir}/src/test/repository.xml"/>
<constructor-arg value="${appserver.base}/jcr"/>
diff --git a/archiva-modules/metadata/metadata-repository-api/pom.xml b/archiva-modules/metadata/metadata-repository-api/pom.xml
index d1847ce83..cbe3affaf 100644
--- a/archiva-modules/metadata/metadata-repository-api/pom.xml
+++ b/archiva-modules/metadata/metadata-repository-api/pom.xml
@@ -57,6 +57,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-assert</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
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 bb9cc49cb..014f755e7 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
@@ -296,6 +296,7 @@ public class DefaultMetadataResolver
try
{
MetadataRepository metadataRepository = session.getRepository();
+
Collection<String> projectVersions = metadataRepository.getProjectVersions( repoId, namespace, projectId );
Collection<String> storageProjectVersions =
repositoryStorage.listProjectVersions( repoId, namespace, projectId,
diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
index afaf1f149..da9099aaa 100644
--- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
+++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
@@ -32,8 +32,11 @@ import org.apache.archiva.metadata.model.Organization;
import org.apache.archiva.metadata.model.ProjectMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.model.Scm;
+import org.fest.assertions.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -64,6 +67,8 @@ public abstract class AbstractMetadataRepositoryTest
private static final String TEST_PROJECT_VERSION = "1.0";
+ private static final String TEST_PROJECT_VERSION_2_0 = "2.0";
+
private static final String TEST_FACET_ID = "test-facet-id";
private static final String TEST_NAME = "test/name";
@@ -78,6 +83,8 @@ public abstract class AbstractMetadataRepositoryTest
private static final String TEST_METADATA_VALUE = "test-metadata";
+ protected Logger log = LoggerFactory.getLogger( getClass() );
+
protected static Map<String, MetadataFacetFactory> createTestMetadataFacetFactories()
{
Map<String, MetadataFacetFactory> factories = new HashMap<String, MetadataFacetFactory>();
@@ -603,6 +610,7 @@ public abstract class AbstractMetadataRepositoryTest
public void testGetMetadataFacetsWhenEmpty()
throws Exception
{
+
List<String> facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID );
assertTrue( facets.isEmpty() );
}
@@ -1049,10 +1057,27 @@ public abstract class AbstractMetadataRepositoryTest
assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>(
repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) );
+ repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION_2_0, artifact );
+
+ Collection<String> versions = repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT );
+
+ log.info( "versions {}", versions );
+
+ Assertions.assertThat( versions ).isNotNull().isNotEmpty().hasSize( 2 ).contains( "1.0", "2.0" );
+
repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() );
+ versions = repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT );
+
+ log.info( "versions {}", versions );
+
+ Assertions.assertThat( versions ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "2.0" );
+
assertTrue(
repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ).isEmpty() );
+
+ Assertions.assertThat( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
+ TEST_PROJECT_VERSION_2_0 ) ).isNotEmpty().hasSize( 1 );
}
@Test
@@ -1093,6 +1118,27 @@ public abstract class AbstractMetadataRepositoryTest
assertTrue( repository.getRootNamespaces( TEST_REPO_ID ).isEmpty() );
}
+
+ @Test
+ public void deleteVersion()
+ throws Exception
+ {
+ ArtifactMetadata artifact = createArtifact();
+ artifact.addFacet( new TestMetadataFacet( "value" ) );
+
+ repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
+
+ repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
+
+ assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>(
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) );
+
+ repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() );
+
+ assertTrue(
+ repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ).isEmpty() );
+ }
+
private static ProjectMetadata createProject()
{
return createProject( TEST_NAMESPACE );
diff --git a/archiva-modules/plugins/metadata-store-file/pom.xml b/archiva-modules/plugins/metadata-store-file/pom.xml
index fd50666e1..951c2e0b4 100644
--- a/archiva-modules/plugins/metadata-store-file/pom.xml
+++ b/archiva-modules/plugins/metadata-store-file/pom.xml
@@ -70,6 +70,11 @@
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-assert</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml
index ea7932b41..218bb3923 100644
--- a/archiva-modules/plugins/metadata-store-jcr/pom.xml
+++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml
@@ -73,6 +73,11 @@
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-assert</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<testResources>
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
index 0ad272528..b0acf2950 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
@@ -35,6 +35,7 @@ import org.apache.archiva.metadata.model.Scm;
import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.archiva.metadata.repository.MetadataRepositoryException;
import org.apache.archiva.metadata.repository.MetadataResolutionException;
+import org.apache.commons.lang.StringUtils;
import org.apache.jackrabbit.commons.JcrUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -615,24 +616,6 @@ public class JcrMetadataRepository
return artifacts;
}
- public void removeArtifact( String repositoryId, String namespace, String projectId, String projectVersion,
- String id )
- throws MetadataRepositoryException
- {
- try
- {
- Node root = getJcrSession().getRootNode();
- String path = getArtifactPath( repositoryId, namespace, projectId, projectVersion, id );
- if ( root.hasNode( path ) )
- {
- root.getNode( path ).remove();
- }
- }
- catch ( RepositoryException e )
- {
- throw new MetadataRepositoryException( e.getMessage(), e );
- }
- }
public void removeRepository( String repositoryId )
throws MetadataRepositoryException
@@ -994,6 +977,40 @@ public class JcrMetadataRepository
return getNodeNames( getProjectPath( repositoryId, namespace, projectId ), PROJECT_VERSION_NODE_TYPE );
}
+ public void removeArtifact( String repositoryId, String namespace, String projectId, String projectVersion,
+ String id )
+ throws MetadataRepositoryException
+ {
+ try
+ {
+ Node root = getJcrSession().getRootNode();
+ String path = getArtifactPath( repositoryId, namespace, projectId, projectVersion, id );
+ if ( root.hasNode( path ) )
+ {
+ root.getNode( path ).remove();
+ }
+
+ // remove version
+
+ path = getProjectPath( repositoryId, namespace, projectId );
+
+ Node nodeAtPath = root.getNode( path );
+
+ for ( Node node : JcrUtils.getChildNodes( nodeAtPath ) )
+ {
+ if ( node.isNodeType( PROJECT_VERSION_NODE_TYPE ) && StringUtils.equals( node.getName(),
+ projectVersion ) )
+ {
+ node.remove();
+ }
+ }
+ }
+ catch ( RepositoryException e )
+ {
+ throw new MetadataRepositoryException( e.getMessage(), e );
+ }
+ }
+
public Collection<ArtifactMetadata> getArtifacts( String repositoryId, String namespace, String projectId,
String projectVersion )
throws MetadataResolutionException
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java
index 365135943..1123eb30a 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java
@@ -77,6 +77,7 @@ public class JcrMetadataRepositoryTest
this.repository = jcrMetadataRepository;
}
+
@After
public void tearDown()
throws Exception