} else {
Store store = getStore();
store.beginTransaction();
try {
final ArtifactDirectoryDescriptor artifactDescriptor = resolveArtifact(artifact, testJar, ArtifactDirectoryDescriptor.class);
consume(scanner.scan(new ClassesDirectory(directory, artifactDescriptor), directoryName, CLASSPATH));
projectDescriptor.getCreatesArtifacts().add(artifactDescriptor);
return artifactDescriptor;
} finally {
store.commitTransaction();
}